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
June
May
April
March
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
July 2007
----- 2025 -----
June 2025
May 2025
April 2025
March 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
957 discussions
Start a n
N
ew thread
Maarten Lankhorst : winealsa: Always commit at least 3 periods in dsoutput.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: ecfafa37c7f4626cb71af3a79fcf551653cc4c3e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ecfafa37c7f4626cb71af3a79…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Sun Jul 29 12:39:49 2007 +0200 winealsa: Always commit at least 3 periods in dsoutput. --- dlls/winealsa.drv/dsoutput.c | 27 +++++---------------------- 1 files changed, 5 insertions(+), 22 deletions(-) diff --git a/dlls/winealsa.drv/dsoutput.c b/dlls/winealsa.drv/dsoutput.c index dbac200..bfe10a6 100644 --- a/dlls/winealsa.drv/dsoutput.c +++ b/dlls/winealsa.drv/dsoutput.c @@ -296,8 +296,6 @@ static HRESULT WINAPI IDsDriverBufferImpl_Unlock(PIDSDRIVERBUFFER iface, return DSERR_UNSUPPORTED; } -static int warnonce; - static HRESULT SetFormat(IDsDriverBufferImpl *This, LPWAVEFORMATEX pwfx, BOOL forced) { snd_pcm_t *pcm = NULL; @@ -382,26 +380,11 @@ static HRESULT SetFormat(IDsDriverBufferImpl *This, LPWAVEFORMATEX pwfx, BOOL fo err = snd_pcm_hw_params_get_period_size(hw_params, &psize, NULL); TRACE("Period size is: %lu\n", psize); - /* If period size is 'high', try to commit less - * dmix needs at least 2 buffers to work successfully but prefers 3 - * however it seems to work ok if I just commit 2 1/2 buffers - */ - if (psize >= 512) - { - if (psize == 1024 && ++warnonce == 1) - FIXME("Your alsa dmix period size is 1024, try decreasing it to 512 if possible\n"); - else if (psize > 512) - WARN("Your alsa period size is excessively high (%lu)\n", psize); - This->mmap_commitahead = 2 * psize + psize/2; - This->mmap_writeahead = 2 * psize; - } - else - { - This->mmap_commitahead = 3 * psize; - while (This->mmap_commitahead <= 512) - This->mmap_commitahead += psize; - This->mmap_writeahead = This->mmap_commitahead; - } + /* ALSA needs at least 3 buffers to work succesfully */ + This->mmap_commitahead = 3 * psize; + while (This->mmap_commitahead <= 512) + This->mmap_commitahead += psize; + This->mmap_writeahead = This->mmap_commitahead; if (This->pcm) {
1
0
0
0
Maarten Lankhorst : winealsa: Increase performance of waveout getposition.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 408abf9a76fbac0d964c4bb7c5f60c1d121b8744 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=408abf9a76fbac0d964c4bb7c…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Fri Jul 6 15:28:31 2007 +0200 winealsa: Increase performance of waveout getposition. --- dlls/winealsa.drv/waveout.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/dlls/winealsa.drv/waveout.c b/dlls/winealsa.drv/waveout.c index 7004e52..6a01df3 100644 --- a/dlls/winealsa.drv/waveout.c +++ b/dlls/winealsa.drv/waveout.c @@ -109,7 +109,7 @@ static BOOL wodUpdatePlayedTotal(WINE_WAVEDEV* wwo, snd_pcm_status_t* ps) WARN("Unexpected state (%d) or delay (%ld) while updating Total Played, resetting\n", state, delay); delay=0; } - wwo->dwPlayedTotal = wwo->dwWrittenTotal - snd_pcm_frames_to_bytes(wwo->pcm, delay); + InterlockedExchange((LONG*)&wwo->dwPlayedTotal, wwo->dwWrittenTotal - snd_pcm_frames_to_bytes(wwo->pcm, delay)); return TRUE; } @@ -444,10 +444,6 @@ static void wodPlayer_ProcessMessages(WINE_WAVEDEV* wwo) wodPlayer_Reset(wwo,TRUE); SetEvent(ev); break; - case WINE_WM_UPDATE: - wodUpdatePlayedTotal(wwo, NULL); - SetEvent(ev); - break; case WINE_WM_BREAKLOOP: if (wwo->state == WINE_WS_PLAYING && wwo->lpLoopPtr != NULL) { /* ensure exit at end of current loop */ @@ -1013,8 +1009,6 @@ static DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) if (lpTime == NULL) return MMSYSERR_INVALPARAM; wwo = &WOutDev[wDevID]; - ALSA_AddRingMessage(&wwo->msgRing, WINE_WM_UPDATE, 0, TRUE); - return ALSA_bytes_to_mmtime(lpTime, wwo->dwPlayedTotal, &wwo->format); }
1
0
0
0
Maarten Lankhorst : winealsa: Increase performance of wavein getposition.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: f45128c2a6bc5c304244c258ead1378a855b6aba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f45128c2a6bc5c304244c258e…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Thu Jul 5 00:41:59 2007 +0200 winealsa: Increase performance of wavein getposition. --- dlls/winealsa.drv/wavein.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dlls/winealsa.drv/wavein.c b/dlls/winealsa.drv/wavein.c index 5d731eb..412edd2 100644 --- a/dlls/winealsa.drv/wavein.c +++ b/dlls/winealsa.drv/wavein.c @@ -154,7 +154,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) DWORD frames_per_period; wwi->state = WINE_WS_STOPPED; - wwi->dwTotalRecorded = 0; + InterlockedExchange((LONG*)&wwi->dwTotalRecorded, 0); wwi->lpQueuePtr = NULL; SetEvent(wwi->hStartUpEvent); @@ -198,7 +198,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) { /* update number of bytes recorded in current buffer and by this device */ lpWaveHdr->dwBytesRecorded += bytesRead; - wwi->dwTotalRecorded += bytesRead; + InterlockedExchangeAdd((LONG*)&wwi->dwTotalRecorded, bytesRead); /* buffer is full. notify client */ if (lpWaveHdr->dwBytesRecorded == lpWaveHdr->dwBufferLength) @@ -247,7 +247,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) /* update number of bytes recorded in current buffer and by this device */ lpWaveHdr->dwBytesRecorded += dwToCopy; - wwi->dwTotalRecorded += dwToCopy; + InterlockedExchangeAdd((LONG*)&wwi->dwTotalRecorded, dwToCopy); bytesRead -= dwToCopy; pOffset += dwToCopy; @@ -385,10 +385,6 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) HeapFree(GetProcessHeap(), 0, buffer); ExitThread(0); /* shouldn't go here */ - case WINE_WM_UPDATE: - SetEvent(ev); - break; - default: FIXME("unknown message %d\n", msg); break; @@ -784,8 +780,6 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) } wwi = &WInDev[wDevID]; - ALSA_AddRingMessage(&wwi->msgRing, WINE_WM_UPDATE, 0, TRUE); - return ALSA_bytes_to_mmtime(lpTime, wwi->dwTotalRecorded, &wwi->format); }
1
0
0
0
Misha Koshelev : msi: Use SysAllocString/ SysFreeString for BSTR members of EXCEPINFO structure.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 03d19b5782e92fba2bea0f1ae5758b30be43666f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=03d19b5782e92fba2bea0f1ae…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Fri Jul 27 23:51:47 2007 -0500 msi: Use SysAllocString/SysFreeString for BSTR members of EXCEPINFO structure. --- dlls/msi/automation.c | 4 ++-- dlls/msi/script.c | 6 ++++++ dlls/msi/tests/automation.c | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c index 97084fc..fb8d4f5 100644 --- a/dlls/msi/automation.c +++ b/dlls/msi/automation.c @@ -426,8 +426,8 @@ static HRESULT WINAPI AutomationObject_Invoke( memset(pExcepInfo, 0, sizeof(EXCEPINFO)); pExcepInfo->wCode = 1000; - pExcepInfo->bstrSource = szExceptionSource; - pExcepInfo->bstrDescription = szExceptionDescription; + pExcepInfo->bstrSource = SysAllocString(szExceptionSource); + pExcepInfo->bstrDescription = SysAllocString(szExceptionDescription); hr = DISP_E_EXCEPTION; } } diff --git a/dlls/msi/script.c b/dlls/msi/script.c index cbce0ce..2f2a17e 100644 --- a/dlls/msi/script.c +++ b/dlls/msi/script.c @@ -336,9 +336,15 @@ static HRESULT WINAPI MsiActiveScriptSite_OnScriptError(IActiveScriptSite* iface TRACE("(%p/%p)->(%p)\n", This, iface, pscripterror); + memset(&exception, 0, sizeof(EXCEPINFO)); hr = IActiveScriptError_GetExceptionInfo(pscripterror, &exception); if (SUCCEEDED(hr)) + { ERR("script error: %s\n", debugstr_w(exception.bstrDescription)); + SysFreeString(exception.bstrSource); + SysFreeString(exception.bstrDescription); + SysFreeString(exception.bstrHelpFile); + } return S_OK; } diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index e7d1847..d2aac28 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -433,6 +433,10 @@ static WCHAR szSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0 ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \ if (excepinfo.bstrDescription) \ ok_w2("Exception description was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrDescription, szDescription); \ +\ + SysFreeString(excepinfo.bstrSource); \ + SysFreeString(excepinfo.bstrDescription); \ + SysFreeString(excepinfo.bstrHelpFile); \ } static DISPID get_dispid( IDispatch *disp, const char *name )
1
0
0
0
Vitaliy Margolen : dinput: Fix typo.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: ed4f1e8ec76d0bf5a615ce83b54c4117c9faadd8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ed4f1e8ec76d0bf5a615ce83b…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sat Jul 28 20:09:43 2007 -0600 dinput: Fix typo. --- dlls/dinput/joystick_linux.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 57f1d7a..9bd423b 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -1208,12 +1208,12 @@ static const IDirectInputDevice8AVtbl JoystickAvt = }; #if !defined(__STRICT_ANSI__) && defined(__GNUC__) -# define XCAST(fun) (typeof(SysJoystickWvt.fun)) +# define XCAST(fun) (typeof(JoystickWvt.fun)) #else # define XCAST(fun) (void*) #endif -static const IDirectInputDevice8WVtbl SysJoystickWvt = +static const IDirectInputDevice8WVtbl JoystickWvt = { IDirectInputDevice2WImpl_QueryInterface, XCAST(AddRef)IDirectInputDevice2AImpl_AddRef,
1
0
0
0
Jason Edmeades : comdlg32: Save dialog works if fred\ entered as filename.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 8707021aaed095b50ba79f05e0494684ecb7c807 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8707021aaed095b50ba79f05e…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Sat Jul 28 20:34:49 2007 +0100 comdlg32: Save dialog works if fred\ entered as filename. --- dlls/comdlg32/filedlg.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index e8e82f2..ca058f2 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -1958,7 +1958,8 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) } else if (!(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE)) { - if(*lpszTemp) /* points to trailing null for last path element */ + if(*lpszTemp || /* points to trailing null for last path element */ + (lpwstrTemp[strlenW(lpwstrTemp)-1] == '\\')) /* or if last element ends in '\' */ { if(fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST) {
1
0
0
0
Robert Millan : ddraw: Remove thread safety FIXMEs.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 47c847663e5d32df7ffb954ddffc12025b789ab4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47c847663e5d32df7ffb954dd…
Author: Robert Millan <rmh(a)aybabtu.com> Date: Sat Jul 28 21:17:19 2007 +0200 ddraw: Remove thread safety FIXMEs. --- dlls/ddraw/ddraw.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index c903ad4..b447403 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -516,8 +516,6 @@ IDirectDrawImpl_SetCooperativeLevel(IDirectDraw7 *iface, if(cooplevel & DDSCL_MULTITHREADED && !(This->cooperative_level & DDSCL_MULTITHREADED)) { - FIXME("DirectDraw is not fully thread safe yet\n"); - /* Enable thread safety in wined3d */ IWineD3DDevice_SetMultithreaded(This->wineD3DDevice); }
1
0
0
0
Juan Lang : crypt32: Implement message stores.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: c7f44c8ec7b497e47d46373faaf38946683d4192 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c7f44c8ec7b497e47d46373fa…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Jul 27 10:59:49 2007 -0700 crypt32: Implement message stores. --- dlls/crypt32/store.c | 166 ++++++++++++++++++++++++++++++++++++++++++++ dlls/crypt32/tests/store.c | 6 -- 2 files changed, 166 insertions(+), 6 deletions(-) diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c index b2be152..2bebb5d 100644 --- a/dlls/crypt32/store.c +++ b/dlls/crypt32/store.c @@ -175,6 +175,14 @@ typedef struct _WINE_FILESTOREINFO BOOL dirty; } WINE_FILESTOREINFO, *PWINE_FILESTOREINFO; +typedef struct _WINE_MSGSTOREINFO +{ + DWORD dwOpenFlags; + HCRYPTPROV cryptProv; + PWINECRYPT_CERTSTORE memStore; + HCRYPTMSG msg; +} WINE_MSGSTOREINFO, *PWINE_MSGSTOREINFO; + typedef struct _WINE_STORE_LIST_ENTRY { PWINECRYPT_CERTSTORE store; @@ -1920,6 +1928,158 @@ static PWINECRYPT_CERTSTORE CRYPT_FileNameOpenStoreA(HCRYPTPROV hCryptProv, return ret; } +static void WINAPI CRYPT_MsgCloseStore(HCERTSTORE hCertStore, DWORD dwFlags) +{ + PWINE_MSGSTOREINFO store = (PWINE_MSGSTOREINFO)hCertStore; + + TRACE("(%p, %08x)\n", store, dwFlags); + CertCloseStore(store->memStore, dwFlags); + CryptMsgClose(store->msg); + CryptMemFree(store); +} + +static void *msgProvFuncs[] = { + CRYPT_MsgCloseStore, + NULL, /* CERT_STORE_PROV_READ_CERT_FUNC */ + NULL, /* CERT_STORE_PROV_WRITE_CERT_FUNC */ + NULL, /* CERT_STORE_PROV_DELETE_CERT_FUNC */ + NULL, /* CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC */ + NULL, /* CERT_STORE_PROV_READ_CRL_FUNC */ + NULL, /* CERT_STORE_PROV_WRITE_CRL_FUNC */ + NULL, /* CERT_STORE_PROV_DELETE_CRL_FUNC */ + NULL, /* CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC */ + NULL, /* CERT_STORE_PROV_READ_CTL_FUNC */ + NULL, /* CERT_STORE_PROV_WRITE_CTL_FUNC */ + NULL, /* CERT_STORE_PROV_DELETE_CTL_FUNC */ + NULL, /* CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC */ + NULL, /* CERT_STORE_PROV_CONTROL_FUNC */ +}; + +static PWINECRYPT_CERTSTORE CRYPT_MsgOpenStore(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + PWINECRYPT_CERTSTORE store = NULL; + HCRYPTMSG msg = (HCRYPTMSG)pvPara; + PWINECRYPT_CERTSTORE memStore; + + TRACE("(%ld, %08x, %p)\n", hCryptProv, dwFlags, pvPara); + + memStore = CRYPT_MemOpenStore(hCryptProv, dwFlags, NULL); + if (memStore) + { + BOOL ret; + DWORD size, count, i; + + size = sizeof(count); + ret = CryptMsgGetParam(msg, CMSG_CERT_COUNT_PARAM, 0, &count, &size); + for (i = 0; ret && i < count; i++) + { + size = 0; + ret = CryptMsgGetParam(msg, CMSG_CERT_PARAM, i, NULL, &size); + if (ret) + { + LPBYTE buf = CryptMemAlloc(size); + + if (buf) + { + ret = CryptMsgGetParam(msg, CMSG_CERT_PARAM, i, buf, &size); + if (ret) + ret = CertAddEncodedCertificateToStore(memStore, + X509_ASN_ENCODING, buf, size, CERT_STORE_ADD_ALWAYS, + NULL); + CryptMemFree(buf); + } + } + } + size = sizeof(count); + ret = CryptMsgGetParam(msg, CMSG_CRL_COUNT_PARAM, 0, &count, &size); + for (i = 0; ret && i < count; i++) + { + size = 0; + ret = CryptMsgGetParam(msg, CMSG_CRL_PARAM, i, NULL, &size); + if (ret) + { + LPBYTE buf = CryptMemAlloc(size); + + if (buf) + { + ret = CryptMsgGetParam(msg, CMSG_CRL_PARAM, i, buf, &size); + if (ret) + ret = CertAddEncodedCRLToStore(memStore, + X509_ASN_ENCODING, buf, size, CERT_STORE_ADD_ALWAYS, + NULL); + CryptMemFree(buf); + } + } + } + if (ret) + { + PWINE_MSGSTOREINFO info = CryptMemAlloc(sizeof(WINE_MSGSTOREINFO)); + + if (info) + { + CERT_STORE_PROV_INFO provInfo = { 0 }; + + info->dwOpenFlags = dwFlags; + info->cryptProv = hCryptProv; + info->memStore = memStore; + info->msg = CryptMsgDuplicate(msg); + provInfo.cbSize = sizeof(provInfo); + provInfo.cStoreProvFunc = sizeof(msgProvFuncs) / + sizeof(msgProvFuncs[0]); + provInfo.rgpvStoreProvFunc = msgProvFuncs; + provInfo.hStoreProv = info; + store = CRYPT_ProvCreateStore(hCryptProv, dwFlags, memStore, + &provInfo); + } + else + CertCloseStore(memStore, 0); + } + else + CertCloseStore(memStore, 0); + } + TRACE("returning %p\n", store); + return store; +} + +static PWINECRYPT_CERTSTORE CRYPT_PKCSOpenStore(HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara) +{ + HCRYPTMSG msg; + PWINECRYPT_CERTSTORE store = NULL; + const CRYPT_DATA_BLOB *data = (const CRYPT_DATA_BLOB *)pvPara; + BOOL ret; + + TRACE("(%ld, %08x, %p)\n", hCryptProv, dwFlags, pvPara); + + msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, CMSG_SIGNED, 0, NULL, + NULL); + ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE); + if (!ret) + { + CryptMsgClose(msg); + msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL); + ret = CryptMsgUpdate(msg, data->pbData, data->cbData, TRUE); + if (ret) + { + DWORD type, size = sizeof(type); + + /* Only signed messages are allowed, check type */ + ret = CryptMsgGetParam(msg, CMSG_TYPE_PARAM, 0, &type, &size); + if (ret && type != CMSG_SIGNED) + { + SetLastError(CRYPT_E_INVALID_MSG_TYPE); + ret = FALSE; + } + } + } + if (ret) + store = CRYPT_MsgOpenStore(hCryptProv, dwFlags, msg); + CryptMsgClose(msg); + TRACE("returning %p\n", store); + return store; +} + static PWINECRYPT_CERTSTORE CRYPT_PhysOpenStoreW(HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara) { @@ -1945,12 +2105,18 @@ HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, { switch (LOWORD(lpszStoreProvider)) { + case (int)CERT_STORE_PROV_MSG: + openFunc = CRYPT_MsgOpenStore; + break; case (int)CERT_STORE_PROV_MEMORY: openFunc = CRYPT_MemOpenStore; break; case (int)CERT_STORE_PROV_FILE: openFunc = CRYPT_FileOpenStore; break; + case (int)CERT_STORE_PROV_PKCS7: + openFunc = CRYPT_PKCSOpenStore; + break; case (int)CERT_STORE_PROV_REG: openFunc = CRYPT_RegOpenStore; break; diff --git a/dlls/crypt32/tests/store.c b/dlls/crypt32/tests/store.c index 96b62f0..450352f 100644 --- a/dlls/crypt32/tests/store.c +++ b/dlls/crypt32/tests/store.c @@ -1398,12 +1398,10 @@ static void testMessageStore(void) */ SetLastError(0xdeadbeef); store = CertOpenStore(CERT_STORE_PROV_MSG, 0, 0, 0, msg); - todo_wine ok(!store && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); CryptMsgUpdate(msg, signedContent, sizeof(signedContent), TRUE); store = CertOpenStore(CERT_STORE_PROV_MSG, 0, 0, 0, msg); - todo_wine ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); if (store) { @@ -1452,7 +1450,6 @@ static void testMessageStore(void) store = CertOpenStore(CERT_STORE_PROV_PKCS7, 0, 0, 0, NULL); */ store = CertOpenStore(CERT_STORE_PROV_PKCS7, 0, 0, 0, &blob); - todo_wine ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); if (store) { @@ -1479,7 +1476,6 @@ static void testMessageStore(void) /* Encoding appears to be ignored */ store = CertOpenStore(CERT_STORE_PROV_PKCS7, X509_ASN_ENCODING, 0, 0, &blob); - todo_wine ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); if (store) CertCloseStore(store, 0); @@ -1488,14 +1484,12 @@ static void testMessageStore(void) blob.pbData = (LPBYTE)hashContent; SetLastError(0xdeadbeef); store = CertOpenStore(CERT_STORE_PROV_PKCS7, 0, 0, 0, &blob); - todo_wine ok(!store && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); blob.cbData = sizeof(hashBareContent); blob.pbData = (LPBYTE)hashBareContent; SetLastError(0xdeadbeef); store = CertOpenStore(CERT_STORE_PROV_PKCS7, 0, 0, 0, &blob); - todo_wine ok(!store && GetLastError() == CRYPT_E_ASN1_BADTAG, "Expected CRYPT_E_ASN1_BADTAG, got %08x\n", GetLastError()); }
1
0
0
0
Juan Lang : crypt32: Only destroy a decoded message's hash if it' s been created.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 6f2ae254410b36a841d2ca9908e6d4dbd37dc511 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6f2ae254410b36a841d2ca990…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Jul 27 10:58:52 2007 -0700 crypt32: Only destroy a decoded message's hash if it's been created. --- dlls/crypt32/msg.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index bca4040..f554c78 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -1255,7 +1255,8 @@ static void CDecodeMsg_Close(HCRYPTMSG hCryptMsg) switch (msg->type) { case CMSG_HASHED: - CryptDestroyHash(msg->u.hash); + if (msg->u.hash) + CryptDestroyHash(msg->u.hash); break; case CMSG_SIGNED: LocalFree(msg->u.signedInfo);
1
0
0
0
Juan Lang : crypt32: Add tests for message stores.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: d76e1899ad85e2766b5a55a00eb8b916f6b027bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d76e1899ad85e2766b5a55a00…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Fri Jul 27 10:58:28 2007 -0700 crypt32: Add tests for message stores. --- dlls/crypt32/tests/store.c | 168 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 168 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/tests/store.c b/dlls/crypt32/tests/store.c index aa8f653..96b62f0 100644 --- a/dlls/crypt32/tests/store.c +++ b/dlls/crypt32/tests/store.c @@ -1333,6 +1333,173 @@ static void testFileNameStore(void) DeleteFileW(filename); } +static const BYTE signedContent[] = { +0x30,0x81,0xb2,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02,0xa0, +0x81,0xa4,0x30,0x81,0xa1,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a, +0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x13,0x06,0x09,0x2a,0x86, +0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x06,0x04,0x04,0x01,0x02,0x03,0x04, +0x31,0x77,0x30,0x75,0x02,0x01,0x01,0x30,0x1a,0x30,0x15,0x31,0x13,0x30,0x11, +0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e, +0x67,0x00,0x02,0x01,0x01,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d, +0x02,0x05,0x05,0x00,0x30,0x04,0x06,0x00,0x05,0x00,0x04,0x40,0x81,0xa6,0x70, +0xb3,0xef,0x59,0xd1,0x66,0xd1,0x9b,0xc0,0x9a,0xb6,0x9a,0x5e,0x6d,0x6f,0x6d, +0x0d,0x59,0xa9,0xaa,0x6e,0xe9,0x2c,0xa0,0x1e,0xee,0xc2,0x60,0xbc,0x59,0xbe, +0x3f,0x63,0x06,0x8d,0xc9,0x11,0x1d,0x23,0x64,0x92,0xef,0x2e,0xfc,0x57,0x29, +0xa4,0xaf,0xe0,0xee,0x93,0x19,0x39,0x51,0xe4,0x44,0xb8,0x0b,0x28,0xf4,0xa8, +0x0d }; +static const BYTE signedWithCertAndCrlBareContent[] = { +0x30,0x82,0x01,0x4f,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06,0x08,0x2a,0x86, +0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x13,0x06,0x09,0x2a,0x86,0x48, +0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x06,0x04,0x04,0x01,0x02,0x03,0x04,0xa0, +0x7c,0x30,0x7a,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30, +0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61, +0x6e,0x67,0x00,0x30,0x22,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31, +0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31, +0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30,0x15,0x31,0x13,0x30,0x11, +0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e, +0x67,0x00,0x30,0x07,0x30,0x02,0x06,0x00,0x03,0x01,0x00,0xa3,0x16,0x30,0x14, +0x30,0x12,0x06,0x03,0x55,0x1d,0x13,0x01,0x01,0xff,0x04,0x08,0x30,0x06,0x01, +0x01,0xff,0x02,0x01,0x01,0xa1,0x2e,0x30,0x2c,0x30,0x02,0x06,0x00,0x30,0x15, +0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e, +0x20,0x4c,0x61,0x6e,0x67,0x00,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30, +0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x31,0x77,0x30,0x75,0x02,0x01,0x01, +0x30,0x1a,0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a, +0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,0x30,0x0c, +0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x04,0x06, +0x00,0x05,0x00,0x04,0x40,0x81,0xa6,0x70,0xb3,0xef,0x59,0xd1,0x66,0xd1,0x9b, +0xc0,0x9a,0xb6,0x9a,0x5e,0x6d,0x6f,0x6d,0x0d,0x59,0xa9,0xaa,0x6e,0xe9,0x2c, +0xa0,0x1e,0xee,0xc2,0x60,0xbc,0x59,0xbe,0x3f,0x63,0x06,0x8d,0xc9,0x11,0x1d, +0x23,0x64,0x92,0xef,0x2e,0xfc,0x57,0x29,0xa4,0xaf,0xe0,0xee,0x93,0x19,0x39, +0x51,0xe4,0x44,0xb8,0x0b,0x28,0xf4,0xa8,0x0d }; +static const BYTE hashContent[] = { +0x30,0x47,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x05,0xa0,0x3a, +0x30,0x38,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d, +0x02,0x05,0x05,0x00,0x30,0x13,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01, +0x07,0x01,0xa0,0x06,0x04,0x04,0x01,0x02,0x03,0x04,0x04,0x10,0x08,0xd6,0xc0, +0x5a,0x21,0x51,0x2a,0x79,0xa1,0xdf,0xeb,0x9d,0x2a,0x8f,0x26,0x2f }; +static const BYTE hashBareContent[] = { +0x30,0x38,0x02,0x01,0x00,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d, +0x02,0x05,0x05,0x00,0x30,0x13,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01, +0x07,0x01,0xa0,0x06,0x04,0x04,0x01,0x02,0x03,0x04,0x04,0x10,0x08,0xd6,0xc0, +0x5a,0x21,0x51,0x2a,0x79,0xa1,0xdf,0xeb,0x9d,0x2a,0x8f,0x26,0x2f }; + +static void testMessageStore(void) +{ + HCERTSTORE store; + HCRYPTMSG msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, + NULL); + CRYPT_DATA_BLOB blob = { sizeof(signedWithCertAndCrlBareContent), + (LPBYTE)signedWithCertAndCrlBareContent }; + DWORD count, size; + BOOL ret; + + /* Crashes + store = CertOpenStore(CERT_STORE_PROV_MSG, 0, 0, 0, NULL); + */ + SetLastError(0xdeadbeef); + store = CertOpenStore(CERT_STORE_PROV_MSG, 0, 0, 0, msg); + todo_wine + ok(!store && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, + "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); + CryptMsgUpdate(msg, signedContent, sizeof(signedContent), TRUE); + store = CertOpenStore(CERT_STORE_PROV_MSG, 0, 0, 0, msg); + todo_wine + ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); + if (store) + { + PCCERT_CONTEXT cert = NULL; + PCCRL_CONTEXT crl = NULL; + + count = 0; + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 0, "Expected 0 certificates, got %d\n", count); + + count = 0; + do { + crl = CertEnumCRLsInStore(store, crl); + if (crl) + count++; + } while (crl); + ok(count == 0, "Expected 0 CRLs, got %d\n", count); + + /* Can add certs to a message store */ + ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, + bigCert, sizeof(bigCert), CERT_STORE_ADD_ALWAYS, NULL); + ok(ret, "CertAddEncodedCertificateToStore failed: %08x\n", + GetLastError()); + count = 0; + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 1, "Expected 1 certificate, got %d\n", count); + + CertCloseStore(store, 0); + } + /* but the added certs weren't actually added to the message */ + size = sizeof(count); + ret = CryptMsgGetParam(msg, CMSG_CERT_COUNT_PARAM, 0, &count, &size); + ok(ret, "CryptMsgGetParam failed: %08x\n", GetLastError()); + ok(count == 0, "Expected 0 certificates, got %d\n", count); + CryptMsgClose(msg); + + /* Crashes + store = CertOpenStore(CERT_STORE_PROV_PKCS7, 0, 0, 0, NULL); + */ + store = CertOpenStore(CERT_STORE_PROV_PKCS7, 0, 0, 0, &blob); + todo_wine + ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); + if (store) + { + DWORD count = 0; + PCCERT_CONTEXT cert = NULL; + PCCRL_CONTEXT crl = NULL; + + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 1, "Expected 1 certificate, got %d\n", count); + + count = 0; + do { + crl = CertEnumCRLsInStore(store, crl); + if (crl) + count++; + } while (crl); + ok(count == 1, "Expected 1 CRL, got %d\n", count); + CertCloseStore(store, 0); + } + /* Encoding appears to be ignored */ + store = CertOpenStore(CERT_STORE_PROV_PKCS7, X509_ASN_ENCODING, 0, 0, + &blob); + todo_wine + ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError()); + if (store) + CertCloseStore(store, 0); + /* Messages other than signed messages aren't allowed */ + blob.cbData = sizeof(hashContent); + blob.pbData = (LPBYTE)hashContent; + SetLastError(0xdeadbeef); + store = CertOpenStore(CERT_STORE_PROV_PKCS7, 0, 0, 0, &blob); + todo_wine + ok(!store && GetLastError() == CRYPT_E_INVALID_MSG_TYPE, + "Expected CRYPT_E_INVALID_MSG_TYPE, got %08x\n", GetLastError()); + blob.cbData = sizeof(hashBareContent); + blob.pbData = (LPBYTE)hashBareContent; + SetLastError(0xdeadbeef); + store = CertOpenStore(CERT_STORE_PROV_PKCS7, 0, 0, 0, &blob); + todo_wine + ok(!store && GetLastError() == CRYPT_E_ASN1_BADTAG, + "Expected CRYPT_E_ASN1_BADTAG, got %08x\n", GetLastError()); +} + static void testCertOpenSystemStore(void) { HCERTSTORE store; @@ -1637,6 +1804,7 @@ START_TEST(store) testSystemStore(); testFileStore(); testFileNameStore(); + testMessageStore(); testCertOpenSystemStore(); testCertEnumSystemStore();
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
96
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
Results per page:
10
25
50
100
200