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
October 2009
----- 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
1207 discussions
Start a n
N
ew thread
Ričardas Barkauskas : dinput: Fix counting non mapped axis as pov.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: 258fd75b39fcbe8ea1782cbbbe3bed37a2c643b5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=258fd75b39fcbe8ea1782cbbb…
Author: Ričardas Barkauskas <miegalius(a)gmail.com> Date: Wed Oct 21 00:12:00 2009 +0300 dinput: Fix counting non mapped axis as pov. --- dlls/dinput/joystick.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index 489342e..84e45c9 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -549,7 +549,9 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_ { This->axis_map[i] = default_axis_map[i]; tokens = default_axis_map[i]; - if (tokens >= 0 && tokens < 8) + if (tokens < 0) + continue; + if (tokens < 8) axis++; else if (tokens < 15) {
1
0
0
0
Juan Lang : crypt32: Encode public keys with NULL parameters if they' re empty (and make tests more restrictive).
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: e1903dc6e06da3fd9faa92fc63e784510ed26626 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e1903dc6e06da3fd9faa92fc6…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 20 13:33:15 2009 -0700 crypt32: Encode public keys with NULL parameters if they're empty (and make tests more restrictive). --- dlls/crypt32/encode.c | 2 +- dlls/crypt32/tests/encode.c | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 93c4a29..3cd2b1e 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -415,7 +415,7 @@ static BOOL WINAPI CRYPT_AsnEncodePubKeyInfo(DWORD dwCertEncodingType, { const CERT_PUBLIC_KEY_INFO *info = pvStructInfo; struct AsnEncodeSequenceItem items[] = { - { &info->Algorithm, CRYPT_AsnEncodeAlgorithmId, 0 }, + { &info->Algorithm, CRYPT_AsnEncodeAlgorithmIdWithNullParams, 0 }, { &info->PublicKey, CRYPT_AsnEncodeBits, 0 }, }; diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 9babafd..1e93dfc 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -2613,8 +2613,8 @@ static void test_decodeExtensions(DWORD dwEncoding) /* MS encodes public key info with a NULL if the algorithm identifier's * parameters are empty. However, when encoding an algorithm in a CERT_INFO, - * it encodes them by omitting the algorithm parameters. This latter approach - * seems more correct, so accept either form. + * it encodes them by omitting the algorithm parameters. It accepts either + * form for decoding. */ struct encodedPublicKey { @@ -2692,16 +2692,11 @@ static void test_encodePublicKeyInfo(DWORD dwEncoding) "CryptEncodeObjectEx failed: %08x\n", GetLastError()); if (buf) { - ok(bufSize == pubKeys[i].encoded[1] + 2 || - bufSize == pubKeys[i].encodedNoNull[1] + 2, - "Expected %d or %d bytes, got %d\n", pubKeys[i].encoded[1] + 2, - pubKeys[i].encodedNoNull[1] + 2, bufSize); + ok(bufSize == pubKeys[i].encoded[1] + 2, + "Expected %d bytes, got %d\n", pubKeys[i].encoded[1] + 2, bufSize); if (bufSize == pubKeys[i].encoded[1] + 2) ok(!memcmp(buf, pubKeys[i].encoded, pubKeys[i].encoded[1] + 2), "Unexpected value\n"); - else if (bufSize == pubKeys[i].encodedNoNull[1] + 2) - ok(!memcmp(buf, pubKeys[i].encodedNoNull, - pubKeys[i].encodedNoNull[1] + 2), "Unexpected value\n"); LocalFree(buf); } }
1
0
0
0
Juan Lang : crypt32: Use helper function to encode public keys for hashing.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: d8ca5bc348b3e033c04ca4ddf9f3786706f78f0e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8ca5bc348b3e033c04ca4ddf…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 20 13:29:03 2009 -0700 crypt32: Use helper function to encode public keys for hashing. This is necessary because the publicly callable form embeds the asn.1 NULL value when the parameters are empty, whereas the hash value expects that it's missing. --- dlls/crypt32/cert.c | 10 ++++++++-- dlls/crypt32/crypt32_private.h | 4 ++++ dlls/crypt32/encode.c | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 5b3b6e3..2115913 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -1855,13 +1855,19 @@ BOOL WINAPI CryptHashPublicKeyInfo(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid, hCryptProv = CRYPT_GetDefaultProvider(); if (!Algid) Algid = CALG_MD5; + if ((dwCertEncodingType & CERT_ENCODING_TYPE_MASK) != X509_ASN_ENCODING) + { + SetLastError(ERROR_FILE_NOT_FOUND); + return FALSE; + } if (ret) { BYTE *buf; DWORD size = 0; - ret = CryptEncodeObjectEx(dwCertEncodingType, X509_PUBLIC_KEY_INFO, - pInfo, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ret = CRYPT_AsnEncodePubKeyInfoNoNull(dwCertEncodingType, + X509_PUBLIC_KEY_INFO, pInfo, CRYPT_ENCODE_ALLOC_FLAG, NULL, + (LPBYTE)&buf, &size); if (ret) { ret = CryptCreateHash(hCryptProv, Algid, 0, 0, &hHash); diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index 07c6382..a5759a2 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -113,6 +113,10 @@ BOOL CRYPT_AsnDecodePKCSDigestedData(const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, CRYPT_DIGESTED_DATA *digestedData, DWORD *pcbDigestedData); +BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded); + /* The following aren't defined in wincrypt.h, as they're "reserved" */ #define CERT_CERT_PROP_ID 32 #define CERT_CRL_PROP_ID 33 diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 627c354..93c4a29 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -464,7 +464,7 @@ static BOOL WINAPI CRYPT_AsnEncodeCert(DWORD dwCertEncodingType, return ret; } -static BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType, +BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) {
1
0
0
0
Juan Lang : crypt32: Add a helper function to encode a cert's public key.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: c97e442a28f1c5c56ff6c1041b925e93e110bff5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c97e442a28f1c5c56ff6c1041…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 20 13:20:59 2009 -0700 crypt32: Add a helper function to encode a cert's public key. --- dlls/crypt32/encode.c | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 01f853c..627c354 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -464,6 +464,25 @@ static BOOL WINAPI CRYPT_AsnEncodeCert(DWORD dwCertEncodingType, return ret; } +static BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + BOOL ret; + const CERT_PUBLIC_KEY_INFO *info = pvStructInfo; + struct AsnEncodeSequenceItem items[] = { + { &info->Algorithm, CRYPT_AsnEncodeAlgorithmId, 0 }, + { &info->PublicKey, CRYPT_AsnEncodeBits, 0 }, + }; + + TRACE("Encoding public key with OID %s\n", + debugstr_a(info->Algorithm.pszObjId)); + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded, + pcbEncoded); + return ret; +} + /* Like in Windows, this blithely ignores the validity of the passed-in * CERT_INFO, and just encodes it as-is. The resulting encoded data may not * decode properly, see CRYPT_AsnDecodeCertInfo. @@ -484,7 +503,7 @@ static BOOL WINAPI CRYPT_AsnEncodeCertInfo(DWORD dwCertEncodingType, { &info->Issuer, CRYPT_CopyEncodedBlob, 0 }, { &info->NotBefore, CRYPT_AsnEncodeValidity, 0 }, { &info->Subject, CRYPT_CopyEncodedBlob, 0 }, - { &info->SubjectPublicKeyInfo, CRYPT_AsnEncodePubKeyInfo, 0 }, + { &info->SubjectPublicKeyInfo, CRYPT_AsnEncodePubKeyInfoNoNull, 0 }, { 0 } }; struct AsnConstructedItem constructed[3] = { { 0 } };
1
0
0
0
Juan Lang : crypt32: Set an output parameter on the success path.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: 43182842cdd8bbbc9b5842545c4130ba1a406b45 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43182842cdd8bbbc9b5842545…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 20 12:48:48 2009 -0700 crypt32: Set an output parameter on the success path. --- dlls/crypt32/encode.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 10d63b4..01f853c 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -4565,6 +4565,7 @@ static BOOL WINAPI CRYPT_ExportRsaPublicKeyInfoEx(HCRYPTPROV_OR_NCRYPT_KEY_HANDL } else { + *pcbInfo = sizeNeeded; pInfo->Algorithm.pszObjId = (char *)pInfo + sizeof(CERT_PUBLIC_KEY_INFO); lstrcpyA(pInfo->Algorithm.pszObjId,
1
0
0
0
Eric Pouech : mmsystem: Create a real function for mciExecute.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: 05e625fe3f3e6a6747725d03fcda95c5470726d3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=05e625fe3f3e6a6747725d03f…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Oct 20 21:55:06 2009 +0200 mmsystem: Create a real function for mciExecute. --- dlls/winmm/mci.c | 1 - dlls/winmm/mci16.c | 8 ++++++++ dlls/winmm/mmsystem.spec | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index f0634a6..8afe14f 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -1500,7 +1500,6 @@ DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet, /************************************************************************** * mciExecute [WINMM.@] - * mciExecute [MMSYSTEM.712] */ BOOL WINAPI mciExecute(LPCSTR lpstrCommand) { diff --git a/dlls/winmm/mci16.c b/dlls/winmm/mci16.c index 33776a0..75d7202 100644 --- a/dlls/winmm/mci16.c +++ b/dlls/winmm/mci16.c @@ -750,3 +750,11 @@ BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable) return FALSE; } + +/************************************************************************** + * mciExecute [MMSYSTEM.712] + */ +BOOL16 WINAPI mciExecute16(LPCSTR lpstrCommand) +{ + return mciExecute(lpstrCommand); +} diff --git a/dlls/winmm/mmsystem.spec b/dlls/winmm/mmsystem.spec index c6b3324..516f027 100644 --- a/dlls/winmm/mmsystem.spec +++ b/dlls/winmm/mmsystem.spec @@ -113,7 +113,7 @@ 708 pascal mciGetDriverData(word) mciGetDriverData16 710 pascal mciDriverYield(word) mciDriverYield16 711 pascal mciDriverNotify(word word word) mciDriverNotify16 -712 pascal mciExecute(ptr) mciExecute +712 pascal mciExecute(ptr) mciExecute16 713 pascal mciFreeCommandResource(word) mciFreeCommandResource16 714 pascal mciSetYieldProc(word ptr long) mciSetYieldProc16 715 pascal mciGetDeviceIDFromElementID(long ptr) mciGetDeviceIDFromElementID16
1
0
0
0
Eric Pouech : winmm: Move the 16=>32W MCI map functions to mci16.c.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: 22daf0e2164be5531d4e3770ea4d2732018ee97c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=22daf0e2164be5531d4e3770e…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Oct 20 21:54:59 2009 +0200 winmm: Move the 16=>32W MCI map functions to mci16.c. --- dlls/winmm/mci16.c | 408 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/winmm/message16.c | 319 ------------------------------------- dlls/winmm/winemm16.h | 3 - 3 files changed, 408 insertions(+), 322 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=22daf0e2164be5531d4e3…
1
0
0
0
Eric Pouech : winmm: Simplify mciLoadCommandResource by dropping 16bit module support.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: ebcbdb9cdc8fbf60993a749a619ca04c80f396e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ebcbdb9cdc8fbf60993a749a6…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Tue Oct 20 21:54:52 2009 +0200 winmm: Simplify mciLoadCommandResource by dropping 16bit module support. --- dlls/winmm/mci.c | 55 ++++++++++++++++++++++------------------------- dlls/winmm/mci16.c | 19 ++++++++++++++++ dlls/winmm/mmsystem.c | 56 ------------------------------------------------- dlls/winmm/winemm.h | 2 - 4 files changed, 45 insertions(+), 87 deletions(-) diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index 5390815..f0634a6 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -84,6 +84,7 @@ static const WCHAR wszSystemIni[] = {'s','y','s','t','e','m','.','i','n','i',0}; static WINE_MCIDRIVER *MciDrivers; static UINT WINAPI MCI_DefYieldProc(MCIDEVICEID wDevID, DWORD data); +static UINT MCI_SetCommandTable(HGLOBAL hMem, UINT uDevType); /* dup a string and uppercase it */ static inline LPWSTR str_dup_upper( LPCWSTR str ) @@ -581,6 +582,7 @@ static DWORD MCI_GetDevTypeFromFileName(LPCWSTR fileName, LPWSTR buf, UINT len) typedef struct tagWINE_MCICMDTABLE { UINT uDevType; + HGLOBAL hMem; const BYTE* lpTable; UINT nVerbs; /* number of verbs in command table */ LPCWSTR* aVerbs; /* array of verbs to speed up the verb look up process */ @@ -694,7 +696,7 @@ static UINT MCI_GetCommandTable(UINT uDevType) if (hRsrc) hMem = LoadResource(hWinMM32Instance, hRsrc); if (hMem) { - uTbl = MCI_SetCommandTable(LockResource(hMem), uDevType); + uTbl = MCI_SetCommandTable(hMem, uDevType); } else { WARN("No command table found in resource %p[%s]\n", hWinMM32Instance, debugstr_w(str)); @@ -707,7 +709,7 @@ static UINT MCI_GetCommandTable(UINT uDevType) /************************************************************************** * MCI_SetCommandTable [internal] */ -UINT MCI_SetCommandTable(void *table, UINT uDevType) +static UINT MCI_SetCommandTable(HGLOBAL hMem, UINT uDevType) { int uTbl; static BOOL bInitDone = FALSE; @@ -721,7 +723,7 @@ UINT MCI_SetCommandTable(void *table, UINT uDevType) bInitDone = TRUE; MCI_GetCommandTable(0); } - TRACE("(%p, %u)\n", table, uDevType); + TRACE("(%p, %u)\n", hMem, uDevType); for (uTbl = 0; uTbl < MAX_MCICMDTABLE; uTbl++) { if (!S_MciCmdTable[uTbl].lpTable) { const BYTE* lmem; @@ -730,7 +732,8 @@ UINT MCI_SetCommandTable(void *table, UINT uDevType) WORD count; S_MciCmdTable[uTbl].uDevType = uDevType; - S_MciCmdTable[uTbl].lpTable = table; + S_MciCmdTable[uTbl].lpTable = LockResource(hMem); + S_MciCmdTable[uTbl].hMem = hMem; if (TRACE_ON(mci)) { MCI_DumpCommandTable(uTbl); @@ -771,21 +774,6 @@ UINT MCI_SetCommandTable(void *table, UINT uDevType) } /************************************************************************** - * MCI_DeleteCommandTable [internal] - */ -BOOL MCI_DeleteCommandTable(UINT uTbl, BOOL delete) -{ - if (uTbl >= MAX_MCICMDTABLE || !S_MciCmdTable[uTbl].lpTable) - return FALSE; - - if (delete) HeapFree(GetProcessHeap(), 0, (void*)S_MciCmdTable[uTbl].lpTable); - S_MciCmdTable[uTbl].lpTable = NULL; - HeapFree(GetProcessHeap(), 0, S_MciCmdTable[uTbl].aVerbs); - S_MciCmdTable[uTbl].aVerbs = 0; - return TRUE; -} - -/************************************************************************** * MCI_UnLoadMciDriver [internal] */ static BOOL MCI_UnLoadMciDriver(LPWINE_MCIDRIVER wmd) @@ -1539,9 +1527,9 @@ BOOL WINAPI mciExecute(LPCSTR lpstrCommand) */ UINT WINAPI mciLoadCommandResource(HINSTANCE hInst, LPCWSTR resNameW, UINT type) { - HRSRC hRsrc = 0; - HGLOBAL hMem; - UINT16 ret = MCI_NO_COMMAND_TABLE; + UINT ret = MCI_NO_COMMAND_TABLE; + HRSRC hRsrc = 0; + HGLOBAL hMem; TRACE("(%p, %s, %d)!\n", hInst, debugstr_w(resNameW), type); @@ -1563,13 +1551,13 @@ UINT WINAPI mciLoadCommandResource(HINSTANCE hInst, LPCWSTR resNameW, UINT type) } #endif } - if (!(hRsrc = FindResourceW(hInst, resNameW, (LPWSTR)RT_RCDATA))) { - WARN("No command table found in resource\n"); - } else if ((hMem = LoadResource(hInst, hRsrc))) { - ret = MCI_SetCommandTable(LockResource(hMem), type); - } else { - WARN("Couldn't load resource.\n"); + if ((hRsrc = FindResourceW(hInst, resNameW, (LPWSTR)RT_RCDATA)) && + (hMem = LoadResource(hInst, hRsrc))) { + ret = MCI_SetCommandTable(hMem, type); + FreeResource(hMem); } + else WARN("No command table found in module for %s\n", debugstr_w(resNameW)); + TRACE("=> %04x\n", ret); return ret; } @@ -1581,7 +1569,16 @@ BOOL WINAPI mciFreeCommandResource(UINT uTable) { TRACE("(%08x)!\n", uTable); - return MCI_DeleteCommandTable(uTable, FALSE); + if (uTable >= MAX_MCICMDTABLE || !S_MciCmdTable[uTable].lpTable) + return FALSE; + + FreeResource(S_MciCmdTable[uTable].hMem); + S_MciCmdTable[uTable].hMem = NULL; + S_MciCmdTable[uTable].lpTable = NULL; + HeapFree(GetProcessHeap(), 0, S_MciCmdTable[uTable].aVerbs); + S_MciCmdTable[uTable].aVerbs = 0; + S_MciCmdTable[uTable].nVerbs = 0; + return TRUE; } /************************************************************************** diff --git a/dlls/winmm/mci16.c b/dlls/winmm/mci16.c index 6155bdb..e1586b7 100644 --- a/dlls/winmm/mci16.c +++ b/dlls/winmm/mci16.c @@ -323,3 +323,22 @@ DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet, { return mciSendStringA(lpstrCommand, lpstrRet, uRetLen, HWND_32(hwndCallback)); } + +/************************************************************************** + * mciLoadCommandResource [MMSYSTEM.705] + */ +UINT16 WINAPI mciLoadCommandResource16(HINSTANCE16 hInst, LPCSTR resname, UINT16 type) +{ + TRACE("(%04x, %s, %x)!\n", hInst, resname, type); + return MCI_NO_COMMAND_TABLE; +} + +/************************************************************************** + * mciFreeCommandResource [MMSYSTEM.713] + */ +BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable) +{ + TRACE("(%04x)!\n", uTable); + + return FALSE; +} diff --git a/dlls/winmm/mmsystem.c b/dlls/winmm/mmsystem.c index 0b4a694..d560773 100644 --- a/dlls/winmm/mmsystem.c +++ b/dlls/winmm/mmsystem.c @@ -2509,62 +2509,6 @@ MMRESULT16 WINAPI timeEndPeriod16(UINT16 wPeriod) return timeEndPeriod(wPeriod); } -/************************************************************************** - * mciLoadCommandResource [MMSYSTEM.705] - */ -UINT16 WINAPI mciLoadCommandResource16(HINSTANCE16 hInst, LPCSTR resname, UINT16 type) -{ - HRSRC16 res; - HGLOBAL16 handle; - const BYTE* ptr16; - BYTE* ptr32; - unsigned pos = 0, size = 1024, len; - const char* str; - DWORD flg; - WORD eid; - UINT16 ret = MCIERR_OUT_OF_MEMORY; - - if (!(res = FindResource16( hInst, resname, (LPSTR)RT_RCDATA))) return MCI_NO_COMMAND_TABLE; - if (!(handle = LoadResource16( hInst, res ))) return MCI_NO_COMMAND_TABLE; - ptr16 = LockResource16(handle); - /* converting the 16 bit resource table into a 32W one */ - if ((ptr32 = HeapAlloc(GetProcessHeap(), 0, size))) - { - do { - str = (LPCSTR)ptr16; - ptr16 += strlen(str) + 1; - flg = *(const DWORD*)ptr16; - eid = *(const WORD*)(ptr16 + sizeof(DWORD)); - ptr16 += sizeof(DWORD) + sizeof(WORD); - len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0) * sizeof(WCHAR); - if (pos + len + sizeof(DWORD) + sizeof(WORD) > size) - { - while (pos + len * sizeof(WCHAR) + sizeof(DWORD) + sizeof(WORD) > size) size += 1024; - ptr32 = HeapReAlloc(GetProcessHeap(), 0, ptr32, size); - if (!ptr32) goto the_end; - } - MultiByteToWideChar(CP_ACP, 0, str, -1, (LPWSTR)(ptr32 + pos), len / sizeof(WCHAR)); - *(DWORD*)(ptr32 + pos + len) = flg; - *(WORD*)(ptr32 + pos + len + sizeof(DWORD)) = eid; - pos += len + sizeof(DWORD) + sizeof(WORD); - } while (eid != MCI_END_COMMAND_LIST); - } -the_end: - FreeResource16( handle ); - if (ptr32) ret = MCI_SetCommandTable(ptr32, type); - return ret; -} - -/************************************************************************** - * mciFreeCommandResource [MMSYSTEM.713] - */ -BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable) -{ - TRACE("(%04x)!\n", uTable); - - return MCI_DeleteCommandTable(uTable, TRUE); -} - /* ################################################### * # JOYSTICK # * ################################################### diff --git a/dlls/winmm/winemm.h b/dlls/winmm/winemm.h index 97403e5..6af5f01 100644 --- a/dlls/winmm/winemm.h +++ b/dlls/winmm/winemm.h @@ -197,8 +197,6 @@ void MMDRV_InstallMap(unsigned int, MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, const char* MCI_MessageToString(UINT wMsg); DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2); -UINT MCI_SetCommandTable(void *table, UINT uDevType); -BOOL MCI_DeleteCommandTable(UINT uTbl, BOOL delete); LPWSTR MCI_strdupAtoW(LPCSTR str); LPSTR MCI_strdupWtoA(LPCWSTR str);
1
0
0
0
Juan Lang : crypt32: Fix duplicating a NULL CTL context.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: dd26bee14c92c60f92177867bf77138907d7fac1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dd26bee14c92c60f92177867b…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 20 09:54:56 2009 -0700 crypt32: Fix duplicating a NULL CTL context. --- dlls/crypt32/ctl.c | 3 ++- dlls/crypt32/tests/ctl.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/ctl.c b/dlls/crypt32/ctl.c index 5a6d19b..1bd60e7 100644 --- a/dlls/crypt32/ctl.c +++ b/dlls/crypt32/ctl.c @@ -455,7 +455,8 @@ end: PCCTL_CONTEXT WINAPI CertDuplicateCTLContext(PCCTL_CONTEXT pCtlContext) { TRACE("(%p)\n", pCtlContext); - Context_AddRef((void *)pCtlContext, sizeof(CTL_CONTEXT)); + if (pCtlContext) + Context_AddRef((void *)pCtlContext, sizeof(CTL_CONTEXT)); return pCtlContext; } diff --git a/dlls/crypt32/tests/ctl.c b/dlls/crypt32/tests/ctl.c index f09420c..8ee2652 100644 --- a/dlls/crypt32/tests/ctl.c +++ b/dlls/crypt32/tests/ctl.c @@ -187,6 +187,21 @@ static void testCreateCTL(void) CertFreeCTLContext(ctl); } +static void testDupCTL(void) +{ + PCCTL_CONTEXT context, dupContext; + + context = CertDuplicateCTLContext(NULL); + ok(context == NULL, "expected NULL\n"); + context = CertCreateCTLContext(X509_ASN_ENCODING, + signedCTLWithCTLInnerContent, sizeof(signedCTLWithCTLInnerContent)); + dupContext = CertDuplicateCTLContext(context); + ok(dupContext != NULL, "expected a context\n"); + ok(dupContext == context, "expected identical context addresses\n"); + CertFreeCTLContext(dupContext); + CertFreeCTLContext(context); +} + static void checkHash(const BYTE *data, DWORD dataLen, ALG_ID algID, PCCTL_CONTEXT context, DWORD propID) { @@ -444,6 +459,7 @@ static void testAddCTLToStore(void) START_TEST(ctl) { testCreateCTL(); + testDupCTL(); testCTLProperties(); testAddCTLToStore(); }
1
0
0
0
Juan Lang : crypt32: Fix duplicating a NULL CRL context.
by Alexandre Julliard
21 Oct '09
21 Oct '09
Module: wine Branch: master Commit: acc9d81f26213628545c546c758f9b9b23633a92 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=acc9d81f26213628545c546c7…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 20 09:52:36 2009 -0700 crypt32: Fix duplicating a NULL CRL context. --- dlls/crypt32/crl.c | 3 ++- dlls/crypt32/tests/crl.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/crl.c b/dlls/crypt32/crl.c index 271e4e0..80fe86f 100644 --- a/dlls/crypt32/crl.c +++ b/dlls/crypt32/crl.c @@ -228,7 +228,8 @@ PCCRL_CONTEXT WINAPI CertGetCRLFromStore(HCERTSTORE hCertStore, PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext) { TRACE("(%p)\n", pCrlContext); - Context_AddRef((void *)pCrlContext, sizeof(CRL_CONTEXT)); + if (pCrlContext) + Context_AddRef((void *)pCrlContext, sizeof(CRL_CONTEXT)); return pCrlContext; } diff --git a/dlls/crypt32/tests/crl.c b/dlls/crypt32/tests/crl.c index abd8491..1b8cb18 100644 --- a/dlls/crypt32/tests/crl.c +++ b/dlls/crypt32/tests/crl.c @@ -118,6 +118,21 @@ static void testCreateCRL(void) CertFreeCRLContext(context); } +static void testDupCRL(void) +{ + PCCRL_CONTEXT context, dupContext; + + context = CertDuplicateCRLContext(NULL); + ok(context == NULL, "expected NULL\n"); + context = CertCreateCRLContext(X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL)); + dupContext = CertDuplicateCRLContext(context); + ok(dupContext != NULL, "expected a context\n"); + ok(dupContext == context, "expected identical context addresses\n"); + CertFreeCRLContext(dupContext); + CertFreeCRLContext(context); +} + static void testAddCRL(void) { HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, @@ -722,6 +737,7 @@ START_TEST(crl) init_function_pointers(); testCreateCRL(); + testDupCRL(); testAddCRL(); testFindCRL(); testGetCRLFromStore();
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
121
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
Results per page:
10
25
50
100
200