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
December 2008
----- 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
2 participants
1225 discussions
Start a n
N
ew thread
Christian Costa : dmusic: Implement IDirectMusic8Impl_CreateMusicBuffer.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: af871d83127c3b2ea39ca7c53d1abb6c2d1bc451 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af871d83127c3b2ea39ca7c53…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Mon Dec 22 14:19:30 2008 +0100 dmusic: Implement IDirectMusic8Impl_CreateMusicBuffer. --- dlls/dmusic/dmusic.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index e2c8d2c..2c6bdd2 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -108,8 +108,16 @@ static HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD dwI static HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer (LPDIRECTMUSIC8 iface, LPDMUS_BUFFERDESC pBufferDesc, LPDIRECTMUSICBUFFER** ppBuffer, LPUNKNOWN pUnkOuter) { IDirectMusic8Impl *This = (IDirectMusic8Impl *)iface; - FIXME("(%p, %p, %p, %p): stub\n", This, pBufferDesc, ppBuffer, pUnkOuter); - return S_OK; + + TRACE("(%p, %p, %p, %p)\n", This, pBufferDesc, ppBuffer, pUnkOuter); + + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + if (!pBufferDesc || !ppBuffer) + return E_POINTER; + + return DMUSIC_CreateDirectMusicBufferImpl(&IID_IDirectMusicBuffer, (LPVOID)ppBuffer, NULL); } static HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLSID rclsidPort, LPDMUS_PORTPARAMS pPortParams, LPDIRECTMUSICPORT* ppPort, LPUNKNOWN pUnkOuter) {
1
0
0
0
Christian Costa : dmusic: Improve IDirectMusicPortDownloadImpl_GetBuffer stub.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: ba081eb22101a7933eadf8d67eeffef04fd1852f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ba081eb22101a7933eadf8d67…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Mon Dec 22 14:08:23 2008 +0100 dmusic: Improve IDirectMusicPortDownloadImpl_GetBuffer stub. --- dlls/dmusic/port.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 618c2e3..5c4e848 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -276,8 +276,13 @@ static ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNL /* IDirectMusicPortDownload Interface follow: */ static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload) { ICOM_THIS_MULTI(IDirectMusicPortImpl, lpDownloadVtbl, iface); + FIXME("(%p/%p)->(%d, %p): stub\n", This, iface, dwDLId, ppIDMDownload); - return S_OK; + + if (!ppIDMDownload) + return E_POINTER; + + return DMUSIC_CreateDirectMusicDownloadImpl(&IID_IDirectMusicDownload, (LPVOID*)ppIDMDownload, NULL); } static HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload) {
1
0
0
0
Christian Costa : dmusic: Fix IDirectMusicPortImpl_QueryInterface.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: f86b6e87f38355ae6c8a17b466268d8ccbe5338c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f86b6e87f38355ae6c8a17b46…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Mon Dec 22 13:58:08 2008 +0100 dmusic: Fix IDirectMusicPortImpl_QueryInterface. --- dlls/dmusic/port.c | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 5264f58..618c2e3 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -23,18 +23,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic); /* IDirectMusicPortImpl IUnknown part: */ static HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT iface, REFIID riid, LPVOID *ppobj) { - IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface; + ICOM_THIS_MULTI(IDirectMusicPortImpl, lpVtbl, iface); + TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPort) || - IsEqualGUID(riid, &IID_IDirectMusicPort8) || - IsEqualGUID(riid, &IID_IDirectMusicPortDownload) || - IsEqualGUID(riid, &IID_IDirectMusicPortDownload8) || - IsEqualGUID(riid, &IID_IDirectMusicThru) || - IsEqualGUID(riid, &IID_IDirectMusicThru8)) { - IUnknown_AddRef(iface); - *ppobj = This; + IsEqualGUID(riid, &IID_IDirectMusicPort8)) { + *ppobj = &This->lpVtbl; + IDirectMusicPort_AddRef((LPDIRECTMUSICPORT)*ppobj); + return S_OK; + } else if (IsEqualGUID(riid, &IID_IDirectMusicPortDownload) || + IsEqualGUID(riid, &IID_IDirectMusicPortDownload8)) { + *ppobj = &This->lpDownloadVtbl; + IDirectMusicPortDownload_AddRef((LPDIRECTMUSICPORTDOWNLOAD)*ppobj); + return S_OK; + } else if (IsEqualGUID(riid, &IID_IDirectMusicThru) || + IsEqualGUID(riid, &IID_IDirectMusicThru8)) { + *ppobj = &This->lpThruVtbl; + IDirectMusicThru_AddRef((LPDIRECTMUSICTHRU)*ppobj); return S_OK; } WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
1
0
0
0
Christian Costa : dmusic: Add support for IID_IDirectMusicDownloadedInstrument8 query in IDirectMusicDownloadedInstrumentImpl_QueryInterface .
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: cff39153109d54b3dae2ead4246152ce426e0034 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cff39153109d54b3dae2ead42…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Mon Dec 22 13:41:27 2008 +0100 dmusic: Add support for IID_IDirectMusicDownloadedInstrument8 query in IDirectMusicDownloadedInstrumentImpl_QueryInterface. --- dlls/dmusic/downloadedinstrument.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/dmusic/downloadedinstrument.c b/dlls/dmusic/downloadedinstrument.c index e20aaf0..2a71a3e 100644 --- a/dlls/dmusic/downloadedinstrument.c +++ b/dlls/dmusic/downloadedinstrument.c @@ -27,7 +27,8 @@ static HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface (LPDIR TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown) - || IsEqualIID (riid, &IID_IDirectMusicDownloadedInstrument)) { + || IsEqualIID (riid, &IID_IDirectMusicDownloadedInstrument) + || IsEqualIID (riid, &IID_IDirectMusicDownloadedInstrument8)) { IUnknown_AddRef(iface); *ppobj = This; return S_OK;
1
0
0
0
Christian Costa : dmusic: Improve IDirectMusicPortImpl_DownloadInstrument stub.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: ceb87f98a236bb82b5e3ac2841b351df24d4ec34 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ceb87f98a236bb82b5e3ac284…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Mon Dec 22 13:40:58 2008 +0100 dmusic: Improve IDirectMusicPortImpl_DownloadInstrument stub. --- dlls/dmusic/port.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 7773d28..5264f58 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -88,8 +88,13 @@ static HRESULT WINAPI IDirectMusicPortImpl_Read (LPDIRECTMUSICPORT iface, LPDIRE static HRESULT WINAPI IDirectMusicPortImpl_DownloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicInstrument* pInstrument, IDirectMusicDownloadedInstrument** ppDownloadedInstrument, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges) { IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface; + FIXME("(%p, %p, %p, %p, %d): stub\n", This, pInstrument, ppDownloadedInstrument, pNoteRanges, dwNumNoteRanges); - return S_OK; + + if (!pInstrument || !ppDownloadedInstrument || (dwNumNoteRanges && !pNoteRanges)) + return E_POINTER; + + return DMUSIC_CreateDirectMusicDownloadedInstrumentImpl(&IID_IDirectMusicDownloadedInstrument, (LPVOID*)ppDownloadedInstrument, NULL); } static HRESULT WINAPI IDirectMusicPortImpl_UnloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *pDownloadedInstrument) {
1
0
0
0
Reece Dunn : dsound: Correct the dsound fraglen calculations.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: ce06de420874b9983324508f8257a580fee341ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ce06de420874b9983324508f8…
Author: Reece Dunn <msclrhd(a)googlemail.com> Date: Mon Dec 22 13:33:43 2008 +0000 dsound: Correct the dsound fraglen calculations. --- dlls/dsound/primary.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 661cd8c..5812f00 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -46,19 +46,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); */ DWORD DSOUND_fraglen(DWORD nSamplesPerSec, DWORD nBlockAlign) { - DWORD fraglen = 256 * nBlockAlign; + /* Given a timer delay of 10ms, the fragment size is approximately: + * fraglen = (nSamplesPerSec * 10 / 1000) * nBlockAlign + * ==> fraglen = (nSamplesPerSec / 100) * nBlockSize + * + * ALSA uses buffers that are powers of 2. Because of this, fraglen + * is rounded up to the nearest power of 2: + */ - /* Compensate for only being roughly accurate */ - if (nSamplesPerSec <= 26000) - fraglen /= 2; + if (nSamplesPerSec <= 12800) + return 128 * nBlockAlign; - if (nSamplesPerSec <= 10000) - fraglen /= 2; + if (nSamplesPerSec <= 25600) + return 256 * nBlockAlign; - if (nSamplesPerSec >= 80000) - fraglen *= 2; + if (nSamplesPerSec <= 51200) + return 512 * nBlockAlign; - return fraglen; + return 1024 * nBlockAlign; } static void DSOUND_RecalcPrimary(DirectSoundDevice *device)
1
0
0
0
Hans Leidekker : wintrust: Implement CryptCATOpen and CryptCATClose.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: f9e0e5198f1d3b4cd6cffe3c96aee15080b15c35 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f9e0e5198f1d3b4cd6cffe3c9…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon Dec 22 14:19:50 2008 +0100 wintrust: Implement CryptCATOpen and CryptCATClose. Based on work done by Maarten Lankhorst. --- dlls/wintrust/crypt.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 169 insertions(+), 3 deletions(-) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index d68267c..4055c55 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -37,8 +37,21 @@ WINE_DEFAULT_DEBUG_CHANNEL(wintrust); #define CATADMIN_MAGIC 0x43415441 /* 'CATA' */ +#define CRYPTCAT_MAGIC 0x43415443 /* 'CATC' */ #define CATINFO_MAGIC 0x43415449 /* 'CATI' */ +struct cryptcat +{ + DWORD magic; + HANDLE msg; + DWORD encoding; + CTL_INFO *inner; + DWORD inner_len; + GUID subject; + DWORD attr_count; + CRYPTCATATTRIBUTE *attr; +}; + struct catadmin { DWORD magic; @@ -465,7 +478,21 @@ BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN hCatAdmin, LPCWSTR pwszCatalogF */ BOOL WINAPI CryptCATClose(HANDLE hCatalog) { - FIXME("(%p) stub\n", hCatalog); + struct cryptcat *cc = hCatalog; + + TRACE("(%p)\n", hCatalog); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + HeapFree(GetProcessHeap(), 0, cc->attr); + HeapFree(GetProcessHeap(), 0, cc->inner); + CryptMsgClose(cc->msg); + + cc->magic = 0; + HeapFree(GetProcessHeap(), 0, cc); return TRUE; } @@ -478,15 +505,154 @@ CRYPTCATMEMBER *WINAPI CryptCATEnumerateMember(HANDLE hCatalog, CRYPTCATMEMBER* return NULL; } +static CTL_INFO *decode_inner_content(HANDLE hmsg, DWORD encoding, DWORD *len) +{ + DWORD size; + LPSTR oid = NULL; + BYTE *buffer = NULL; + CTL_INFO *inner = NULL; + + if (!CryptMsgGetParam(hmsg, CMSG_INNER_CONTENT_TYPE_PARAM, 0, NULL, &size)) return NULL; + if (!(oid = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + return NULL; + } + if (!CryptMsgGetParam(hmsg, CMSG_INNER_CONTENT_TYPE_PARAM, 0, oid, &size)) goto out; + if (!CryptMsgGetParam(hmsg, CMSG_CONTENT_PARAM, 0, NULL, &size)) goto out; + if (!(buffer = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + goto out; + } + if (!CryptMsgGetParam(hmsg, CMSG_CONTENT_PARAM, 0, buffer, &size)) goto out; + if (!CryptDecodeObject(encoding, oid, buffer, size, 0, NULL, &size)) goto out; + if (!(inner = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + goto out; + } + if (!CryptDecodeObject(encoding, oid, buffer, size, 0, inner, &size)) goto out; + *len = size; + +out: + HeapFree(GetProcessHeap(), 0, oid); + HeapFree(GetProcessHeap(), 0, buffer); + return inner; +} + /*********************************************************************** * CryptCATOpen (WINTRUST.@) */ HANDLE WINAPI CryptCATOpen(LPWSTR pwszFileName, DWORD fdwOpenFlags, HCRYPTPROV hProv, DWORD dwPublicVersion, DWORD dwEncodingType) { - FIXME("(%s, %d, %ld, %d, %d) stub\n", debugstr_w(pwszFileName), fdwOpenFlags, + HANDLE file, hmsg; + BYTE *buffer = NULL; + DWORD size, flags = OPEN_EXISTING; + struct cryptcat *cc; + + TRACE("%s, %x, %lx, %x, %x\n", debugstr_w(pwszFileName), fdwOpenFlags, hProv, dwPublicVersion, dwEncodingType); - return 0; + + if (!pwszFileName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return INVALID_HANDLE_VALUE; + } + + if (!dwPublicVersion) dwPublicVersion = 0x00000100; + if (!dwEncodingType) dwEncodingType = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING; + + if (fdwOpenFlags & CRYPTCAT_OPEN_ALWAYS) flags |= OPEN_ALWAYS; + if (fdwOpenFlags & CRYPTCAT_OPEN_CREATENEW) flags |= CREATE_NEW; + + file = CreateFileW(pwszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, flags, 0, NULL); + if (file == INVALID_HANDLE_VALUE) return INVALID_HANDLE_VALUE; + + size = GetFileSize(file, NULL); + if (!(buffer = HeapAlloc(GetProcessHeap(), 0, size))) + { + CloseHandle(file); + SetLastError(ERROR_OUTOFMEMORY); + return INVALID_HANDLE_VALUE; + } + if (!(hmsg = CryptMsgOpenToDecode(dwEncodingType, 0, 0, hProv, NULL, NULL))) + { + CloseHandle(file); + HeapFree(GetProcessHeap(), 0, buffer); + return INVALID_HANDLE_VALUE; + } + if (!ReadFile(file, buffer, size, &size, NULL) || !CryptMsgUpdate(hmsg, buffer, size, TRUE)) + { + CloseHandle(file); + HeapFree(GetProcessHeap(), 0, buffer); + CryptMsgClose(hmsg); + return INVALID_HANDLE_VALUE; + } + HeapFree(GetProcessHeap(), 0, buffer); + CloseHandle(file); + + size = sizeof(DWORD); + if (!(cc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cc)))) + { + CryptMsgClose(hmsg); + SetLastError(ERROR_OUTOFMEMORY); + return INVALID_HANDLE_VALUE; + } + + cc->msg = hmsg; + cc->encoding = dwEncodingType; + if (CryptMsgGetParam(hmsg, CMSG_ATTR_CERT_COUNT_PARAM, 0, &cc->attr_count, &size)) + { + DWORD i, sum = 0; + BYTE *p; + + for (i = 0; i < cc->attr_count; i++) + { + if (!CryptMsgGetParam(hmsg, CMSG_ATTR_CERT_PARAM, i, NULL, &size)) + { + CryptMsgClose(hmsg); + return INVALID_HANDLE_VALUE; + } + sum += size; + } + if (!(cc->attr = HeapAlloc(GetProcessHeap(), 0, sizeof(*cc->attr) * cc->attr_count + sum))) + { + CryptMsgClose(hmsg); + SetLastError(ERROR_OUTOFMEMORY); + return INVALID_HANDLE_VALUE; + } + p = (BYTE *)(cc->attr + cc->attr_count); + for (i = 0; i < cc->attr_count; i++) + { + if (!CryptMsgGetParam(hmsg, CMSG_ATTR_CERT_PARAM, i, NULL, &size)) + { + CryptMsgClose(hmsg); + HeapFree(GetProcessHeap(), 0, cc->attr); + return INVALID_HANDLE_VALUE; + } + if (!CryptMsgGetParam(hmsg, CMSG_ATTR_CERT_PARAM, i, p, &size)) + { + CryptMsgClose(hmsg); + HeapFree(GetProcessHeap(), 0, cc->attr); + return INVALID_HANDLE_VALUE; + } + p += size; + } + cc->inner = decode_inner_content(hmsg, dwEncodingType, &cc->inner_len); + if (!cc->inner || !CryptSIPRetrieveSubjectGuid(pwszFileName, NULL, &cc->subject)) + { + CryptMsgClose(hmsg); + HeapFree(GetProcessHeap(), 0, cc->attr); + HeapFree(GetProcessHeap(), 0, cc->inner); + HeapFree(GetProcessHeap(), 0, cc); + return INVALID_HANDLE_VALUE; + } + cc->magic = CRYPTCAT_MAGIC; + return cc; + } + return INVALID_HANDLE_VALUE; } /***********************************************************************
1
0
0
0
Hans Leidekker : wintrust: Implement CryptCATAdminEnumCatalogFromHash.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: 766669fbd2e31ab0227adfc91e0158be5a090d06 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=766669fbd2e31ab0227adfc91…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon Dec 22 14:19:35 2008 +0100 wintrust: Implement CryptCATAdminEnumCatalogFromHash. Based on work done by Maarten Lankhorst. --- dlls/wintrust/crypt.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 130 insertions(+), 5 deletions(-) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index b14fca6..d68267c 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -43,6 +43,7 @@ struct catadmin { DWORD magic; WCHAR path[MAX_PATH]; + HANDLE find; }; struct catinfo @@ -51,6 +52,20 @@ struct catinfo WCHAR file[MAX_PATH]; }; +static HCATINFO create_catinfo(const WCHAR *filename) +{ + struct catinfo *ci; + + if (!(ci = HeapAlloc(GetProcessHeap(), 0, sizeof(*ci)))) + { + SetLastError(ERROR_OUTOFMEMORY); + return INVALID_HANDLE_VALUE; + } + strcpyW(ci->file, filename); + ci->magic = CATINFO_MAGIC; + return ci; +} + /*********************************************************************** * CryptCATAdminAcquireContext (WINTRUST.@) * @@ -111,6 +126,8 @@ BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN *catAdmin, CreateDirectoryW(ca->path, NULL); ca->magic = CATADMIN_MAGIC; + ca->find = NULL; + *catAdmin = ca; return TRUE; } @@ -234,13 +251,120 @@ BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash, /*********************************************************************** * CryptCATAdminEnumCatalogFromHash (WINTRUST.@) */ -HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin, - BYTE* pbHash, - DWORD cbHash, - DWORD dwFlags, +HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin, BYTE* pbHash, + DWORD cbHash, DWORD dwFlags, HCATINFO* phPrevCatInfo ) { - FIXME("%p %p %d %d %p\n", hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo); + static const WCHAR slashW[] = {'\\',0}; + static const WCHAR globW[] = {'\\','*','.','c','a','t',0}; + + struct catadmin *ca = hCatAdmin; + WIN32_FIND_DATAW data; + HCATINFO prev = NULL; + HCRYPTPROV prov; + DWORD size; + BOOL ret; + + TRACE("%p %p %d %x %p\n", hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo); + + if (!ca || ca->magic != CATADMIN_MAGIC || !pbHash || cbHash != 20 || dwFlags) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + if (phPrevCatInfo) prev = *phPrevCatInfo; + + ret = CryptAcquireContextW(&prov, NULL, MS_DEF_PROV_W, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); + if (!ret) return NULL; + + if (!prev) + { + WCHAR *path; + + size = strlenW(ca->path) * sizeof(WCHAR) + sizeof(globW); + if (!(path = HeapAlloc(GetProcessHeap(), 0, size))) + { + CryptReleaseContext(prov, 0); + SetLastError(ERROR_OUTOFMEMORY); + return NULL; + } + strcpyW(path, ca->path); + strcatW(path, globW); + + if (ca->find) FindClose(ca->find); + ca->find = FindFirstFileW(path, &data); + + HeapFree(GetProcessHeap(), 0, path); + if (!ca->find) + { + CryptReleaseContext(prov, 0); + return NULL; + } + } + else if (!FindNextFileW(ca->find, &data)) + { + CryptCATAdminReleaseCatalogContext(hCatAdmin, prev, 0); + CryptReleaseContext(prov, 0); + return NULL; + } + + while (1) + { + WCHAR *filename; + CRYPTCATMEMBER *member = NULL; + struct catinfo *ci; + HANDLE hcat; + + size = (strlenW(ca->path) + strlenW(data.cFileName) + 2) * sizeof(WCHAR); + if (!(filename = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + return NULL; + } + strcpyW(filename, ca->path); + strcatW(filename, slashW); + strcatW(filename, data.cFileName); + + hcat = CryptCATOpen(filename, CRYPTCAT_OPEN_EXISTING, prov, 0, 0); + if (hcat == INVALID_HANDLE_VALUE) + { + WARN("couldn't open %s (%u)\n", debugstr_w(filename), GetLastError()); + continue; + } + while ((member = CryptCATEnumerateMember(hcat, member))) + { + if (member->pIndirectData->Digest.cbData != cbHash) + { + WARN("amount of hash bytes differs: %u/%u\n", member->pIndirectData->Digest.cbData, cbHash); + continue; + } + if (!memcmp(member->pIndirectData->Digest.pbData, pbHash, cbHash)) + { + TRACE("file %s matches\n", debugstr_w(data.cFileName)); + + CryptCATClose(hcat); + CryptReleaseContext(prov, 0); + if (!phPrevCatInfo) + { + FindClose(ca->find); + ca->find = NULL; + } + ci = create_catinfo(filename); + HeapFree(GetProcessHeap(), 0, filename); + return ci; + } + } + CryptCATClose(hcat); + HeapFree(GetProcessHeap(), 0, filename); + + if (!FindNextFileW(ca->find, &data)) + { + FindClose(ca->find); + ca->find = NULL; + CryptReleaseContext(prov, 0); + return NULL; + } + } return NULL; } @@ -302,6 +426,7 @@ BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags ) SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } + if (ca->find) FindClose(ca->find); ca->magic = 0; return HeapFree(GetProcessHeap(), 0, ca); }
1
0
0
0
Hans Leidekker : wintrust: Record full catalog filename in catalog info structure, not just the basename.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: 21d5f4a61747d9c066fbe8f646625dbbc8aa3ae4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=21d5f4a61747d9c066fbe8f64…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon Dec 22 14:19:14 2008 +0100 wintrust: Record full catalog filename in catalog info structure, not just the basename. --- dlls/wintrust/crypt.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 6337a85..b14fca6 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -134,19 +134,19 @@ HCATINFO WINAPI CryptCATAdminAddCatalog(HCATADMIN catAdmin, PWSTR catalogFile, { FIXME("NULL basename not handled\n"); SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + return NULL; } if (!ca || ca->magic != CATADMIN_MAGIC || !catalogFile || flags) { SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + return NULL; } len = strlenW(ca->path) + strlenW(selectBaseName) + 2; if (!(target = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) { SetLastError(ERROR_OUTOFMEMORY); - return FALSE; + return NULL; } strcpyW(target, ca->path); strcatW(target, slashW); @@ -161,10 +161,10 @@ HCATINFO WINAPI CryptCATAdminAddCatalog(HCATADMIN catAdmin, PWSTR catalogFile, { HeapFree(GetProcessHeap(), 0, target); SetLastError(ERROR_OUTOFMEMORY); - return FALSE; + return NULL; } ci->magic = CATINFO_MAGIC; - strcpyW(ci->file, selectBaseName); + strcpyW(ci->file, target); HeapFree(GetProcessHeap(), 0, target); return ci;
1
0
0
0
Hans Leidekker : include/mscat.h: Add a few declarations.
by Alexandre Julliard
22 Dec '08
22 Dec '08
Module: wine Branch: master Commit: 5a25ffe435c7409987acf7d3590eff60f0427d70 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a25ffe435c7409987acf7d35…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon Dec 22 14:19:00 2008 +0100 include/mscat.h: Add a few declarations. --- include/mscat.h | 37 +++++++++++++++++++++++++++++++++++-- 1 files changed, 35 insertions(+), 2 deletions(-) diff --git a/include/mscat.h b/include/mscat.h index e481207..d037adc 100644 --- a/include/mscat.h +++ b/include/mscat.h @@ -28,10 +28,30 @@ typedef HANDLE HCATINFO; extern "C" { #endif +#define CRYPTCAT_OPEN_CREATENEW 0x00000001 +#define CRYPTCAT_OPEN_ALWAYS 0x00000002 +#define CRYPTCAT_OPEN_EXISTING 0x00000004 +#define CRYPTCAT_OPEN_EXCLUDE_PAGE_HASHES 0x00010000 +#define CRYPTCAT_OPEN_INCLUDE_PAGE_HASHES 0x00020000 +#define CRYPTCAT_OPEN_VERIFYSIGHASH 0x10000000 +#define CRYPTCAT_OPEN_NO_CONTENT_HCRYPTMSG 0x20000000 +#define CRYPTCAT_OPEN_SORTED 0x40000000 +#define CRYPTCAT_OPEN_FLAGS_MASK 0xffff0000 #include <pshpack8.h> -typedef struct CRYPTCATMEMBER_ { +typedef struct CRYPTCATATTRIBUTE_ +{ + DWORD cbStruct; + LPWSTR pwszReferenceTag; + DWORD dwAttrTypeAndAction; + DWORD cbValue; + BYTE *pbValue; + DWORD dwReserved; +} CRYPTCATATTRIBUTE; + +typedef struct CRYPTCATMEMBER_ +{ DWORD cbStruct; LPWSTR pwszReferenceTag; LPWSTR pwszFileName; @@ -45,6 +65,12 @@ typedef struct CRYPTCATMEMBER_ { CRYPT_ATTR_BLOB sEncodedMemberInfo; } CRYPTCATMEMBER; +typedef struct CATALOG_INFO_ +{ + DWORD cbStruct; + WCHAR wszCatalogFile[MAX_PATH]; +} CATALOG_INFO; + #include <poppack.h> @@ -55,8 +81,15 @@ HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN,BYTE*,DWORD,DWORD,HC BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN,HCATINFO,DWORD); BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN,DWORD); BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN,LPCWSTR,DWORD); +BOOL WINAPI CryptCATAdminResolveCatalogPath(HCATADMIN, WCHAR *, CATALOG_INFO *, DWORD); +BOOL WINAPI CryptCATCatalogInfoFromContext(HCATINFO, CATALOG_INFO *, DWORD); BOOL WINAPI CryptCATClose(HANDLE); -CRYPTCATMEMBER* WINAPI CryptCATEnumerateMember(HANDLE,CRYPTCATMEMBER*); +CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateAttr(HANDLE, CRYPTCATMEMBER *, CRYPTCATATTRIBUTE *); +CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateCatAttr(HANDLE, CRYPTCATATTRIBUTE *); +CRYPTCATMEMBER * WINAPI CryptCATEnumerateMember(HANDLE,CRYPTCATMEMBER *); +CRYPTCATATTRIBUTE * WINAPI CryptCATGetAttrInfo(HANDLE, CRYPTCATMEMBER *, LPWSTR); +CRYPTCATATTRIBUTE * WINAPI CryptCATGetCatAttrInfo(HANDLE, LPWSTR); +CRYPTCATMEMBER * WINAPI CryptCATGetMemberInfo(HANDLE, LPWSTR); HANDLE WINAPI CryptCATOpen(LPWSTR,DWORD,HCRYPTPROV,DWORD,DWORD); #ifdef __cplusplus
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
123
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Results per page:
10
25
50
100
200