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
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
May 2006
----- 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
863 discussions
Start a n
N
ew thread
Jacek Caban : urlmon: Use FindMimeFromData to determine MIME type.
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: db24fff13ea96ff281077bb6e4f5ee2f16934e1e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=db24fff13ea96ff281077bb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 14:33:30 2006 +0200 urlmon: Use FindMimeFromData to determine MIME type. --- dlls/urlmon/binding.c | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c index 11b067c..e64cef7 100644 --- a/dlls/urlmon/binding.c +++ b/dlls/urlmon/binding.c @@ -53,6 +53,7 @@ typedef struct { DWORD bindf; LPWSTR mime; LPWSTR url; + BOOL verified_mime; DWORD apartment_thread; HWND notif_hwnd; @@ -737,6 +738,7 @@ static HRESULT WINAPI InternetProtocolSi on_progress(This, 0, 0, BINDSTATUS_SENDINGREQUEST, szStatusText); break; case BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE: + This->verified_mime = TRUE; on_progress(This, 0, 0, BINDSTATUS_MIMETYPEAVAILABLE, szStatusText); break; case BINDSTATUS_CACHEFILENAMEAVAILABLE: @@ -757,10 +759,25 @@ static HRESULT WINAPI InternetProtocolSi TRACE("(%p)->(%ld %lu %lu)\n", This, grfBSCF, ulProgress, ulProgressMax); - if(grfBSCF & BSCF_FIRSTDATANOTIFICATION) { + fill_stream_buffer(This->stream); + + if(!This->verified_mime) { + LPWSTR mime; + + This->verified_mime = TRUE; + + /* FIXME: Always call FindMediaFromData (its implementation is not yet ready for this). */ if(This->mime) - IBindStatusCallback_OnProgress(This->callback, ulProgress, ulProgressMax, - BINDSTATUS_MIMETYPEAVAILABLE, This->mime); + mime = This->mime; + else + FindMimeFromData(NULL, This->url, This->stream->buf, + min(This->stream->buf_size, 255), This->mime, 0, &mime, 0); + + IBindStatusCallback_OnProgress(This->callback, ulProgress, ulProgressMax, + BINDSTATUS_MIMETYPEAVAILABLE, mime); + } + + if(grfBSCF & BSCF_FIRSTDATANOTIFICATION) { IBindStatusCallback_OnProgress(This->callback, ulProgress, ulProgressMax, BINDSTATUS_BEGINDOWNLOADDATA, This->url); } @@ -772,8 +789,6 @@ static HRESULT WINAPI InternetProtocolSi if(grfBSCF & BSCF_FIRSTDATANOTIFICATION) IInternetProtocol_LockRequest(This->protocol, 0); - fill_stream_buffer(This->stream); - formatetc.cfFormat = 0; /* FIXME */ formatetc.ptd = NULL; formatetc.dwAspect = 1; @@ -1028,6 +1043,7 @@ static HRESULT Binding_Create(LPCWSTR ur ret->url = NULL; ret->apartment_thread = GetCurrentThreadId(); ret->notif_hwnd = get_notif_hwnd(); + ret->verified_mime = FALSE; memset(&ret->bindinfo, 0, sizeof(BINDINFO)); ret->bindinfo.cbSize = sizeof(BINDINFO);
1
0
0
0
Huw Davies : rpcrt4: Add ENUM32 support to ComplexStructMemorySize.
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: bb835ae438070f5f25482cfef9419f894735351e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=bb835ae438070f5f25482cf…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed May 31 12:44:13 2006 +0100 rpcrt4: Add ENUM32 support to ComplexStructMemorySize. --- dlls/rpcrt4/ndr_marshall.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 438d9e5..582851b 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -1889,6 +1889,7 @@ static unsigned long ComplexStructMemory break; case RPC_FC_LONG: case RPC_FC_ULONG: + case RPC_FC_ENUM32: size += 4; pStubMsg->Buffer += 4; break;
1
0
0
0
Robert Shearman : oleaut32: Make sure to read the memid and the name offset from the
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: 9c738061e0a0cb029a420a6f105699e27b2a6d69 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=9c738061e0a0cb029a420a6…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Wed May 31 12:20:39 2006 +0100 oleaut32: Make sure to read the memid and the name offset from the correct offsets, after the function data, so add cFuncs to the offsets in MSFT_DoVars. Resolve referenced types for variables. Fixes initialisation of the dbgrid32 OCX. --- dlls/oleaut32/typelib.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 25a5354..ce4f02f 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -1899,7 +1899,7 @@ static void MSFT_DoVars(TLBContext *pcx, *pptvd=TLB_Alloc(sizeof(TLBVarDesc)); /* name, eventually add to a hash table */ MSFT_ReadLEDWords(&nameoffset, sizeof(INT), pcx, - offset + infolen + (cFuncs + cVars + i + 1) * sizeof(INT)); + offset + infolen + (2*cFuncs + cVars + i + 1) * sizeof(INT)); (*pptvd)->Name=MSFT_ReadName(pcx, nameoffset); /* read the variable information record */ MSFT_ReadLEDWords(&reclength, sizeof(INT), pcx, recoffset); @@ -1915,7 +1915,7 @@ static void MSFT_DoVars(TLBContext *pcx, (*pptvd)->HelpStringContext=pVarRec->HelpStringContext; /* fill the VarDesc Structure */ MSFT_ReadLEDWords(&(*pptvd)->vardesc.memid, sizeof(INT), pcx, - offset + infolen + ( i + 1) * sizeof(INT)); + offset + infolen + (cFuncs + i + 1) * sizeof(INT)); (*pptvd)->vardesc.varkind = pVarRec->VarKind; (*pptvd)->vardesc.wVarFlags = pVarRec->Flags; MSFT_GetTdesc(pcx, pVarRec->DataType, @@ -1927,6 +1927,7 @@ static void MSFT_DoVars(TLBContext *pcx, pVarRec->OffsValue, pcx); } else (*pptvd)->vardesc.u.oInst=pVarRec->OffsValue; + MSFT_ResolveReferencedTypes(pcx, pTI, &(*pptvd)->vardesc.elemdescVar.tdesc); pptvd=&((*pptvd)->next); recoffset += reclength; }
1
0
0
0
Robert Shearman : oleaut32: Resolve referenced types for return values as well as parameters in MSFT typelibs .
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: 983ad4accd2bcbf53dc32d53fd92538ac09d9467 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=983ad4accd2bcbf53dc32d5…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Wed May 31 12:20:31 2006 +0100 oleaut32: Resolve referenced types for return values as well as parameters in MSFT typelibs. --- dlls/oleaut32/typelib.c | 57 +++++++++++++++++++++++++---------------------- 1 files changed, 30 insertions(+), 27 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 27cfdd5..25a5354 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -1643,6 +1643,34 @@ static void MSFT_GetTdesc(TLBContext *pc TRACE_(typelib)("vt type = %X\n", pTd->vt); } +static void MSFT_ResolveReferencedTypes(TLBContext *pcx, ITypeInfoImpl *pTI, TYPEDESC *lpTypeDesc) +{ + /* resolve referenced type if any */ + while (lpTypeDesc) + { + switch (lpTypeDesc->vt) + { + case VT_PTR: + lpTypeDesc = lpTypeDesc->u.lptdesc; + break; + + case VT_CARRAY: + lpTypeDesc = & (lpTypeDesc->u.lpadesc->tdescElem); + break; + + case VT_USERDEFINED: + MSFT_DoRefType(pcx, pTI, + lpTypeDesc->u.hreftype); + + lpTypeDesc = NULL; + break; + + default: + lpTypeDesc = NULL; + } + } +} + static void MSFT_DoFuncs(TLBContext* pcx, ITypeInfoImpl* pTI, @@ -1764,6 +1792,7 @@ MSFT_DoFuncs(TLBContext* pcx, pFuncRec->DataType, &(*pptfd)->funcdesc.elemdescFunc.tdesc, pTI); + MSFT_ResolveReferencedTypes(pcx, pTI, &(*pptfd)->funcdesc.elemdescFunc.tdesc); /* do the parameters/arguments */ if(pFuncRec->nrargs) @@ -1782,7 +1811,6 @@ MSFT_DoFuncs(TLBContext* pcx, for ( j = 0 ; j < pFuncRec->nrargs ; j++ ) { - TYPEDESC *lpArgTypeDesc; ELEMDESC *elemdesc = &(*pptfd)->funcdesc.lprgelemdescParam[j]; MSFT_GetTdesc(pcx, @@ -1803,32 +1831,7 @@ MSFT_DoFuncs(TLBContext* pcx, MSFT_ReadName( pcx, paraminfo.oName ); TRACE_(typelib)("param[%d] = %s\n", j, debugstr_w((*pptfd)->pParamDesc[j].Name)); - lpArgTypeDesc = &elemdesc->tdesc; - - /* resolve referenced type if any */ - while ( lpArgTypeDesc != NULL ) - { - switch ( lpArgTypeDesc->vt ) - { - case VT_PTR: - lpArgTypeDesc = lpArgTypeDesc->u.lptdesc; - break; - - case VT_CARRAY: - lpArgTypeDesc = & (lpArgTypeDesc->u.lpadesc->tdescElem); - break; - - case VT_USERDEFINED: - MSFT_DoRefType(pcx, pTI, - lpArgTypeDesc->u.hreftype); - - lpArgTypeDesc = NULL; - break; - - default: - lpArgTypeDesc = NULL; - } - } + MSFT_ResolveReferencedTypes(pcx, pTI, &elemdesc->tdesc); /* default value */ if ( (elemdesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT) &&
1
0
0
0
Robert Shearman : widl: Allow some more "reserved words" to be used as identifiers.
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: fa4f94bdd594961684009fd877b0c32a692855cb URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=fa4f94bdd594961684009fd…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Wed May 31 12:21:02 2006 +0100 widl: Allow some more "reserved words" to be used as identifiers. --- tools/widl/parser.y | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 8e16b22..026b716 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -568,8 +568,10 @@ ident: aIDENTIFIER { $$ = make_var( | tASYNC { $$ = make_var($<str>1); } | tID { $$ = make_var($<str>1); } | tLCID { $$ = make_var($<str>1); } + | tOBJECT { $$ = make_var($<str>1); } | tRANGE { $$ = make_var($<str>1); } | tRETVAL { $$ = make_var($<str>1); } + | tUUID { $$ = make_var($<str>1); } | tVERSION { $$ = make_var($<str>1); } ;
1
0
0
0
Robert Shearman : include: Add some defines used by MIDL-generated code.
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: caa94a03a491d08ded58cb5bca08c0ebb3c5f238 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=caa94a03a491d08ded58cb5…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Wed May 31 12:20:22 2006 +0100 include: Add some defines used by MIDL-generated code. --- include/rpcdcep.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/rpcdcep.h b/include/rpcdcep.h index 071b4e5..6c3f41f 100644 --- a/include/rpcdcep.h +++ b/include/rpcdcep.h @@ -44,6 +44,11 @@ typedef struct _RPC_MESSAGE unsigned long RpcFlags; } RPC_MESSAGE, *PRPC_MESSAGE; +#define RPC_NCA_FLAGS_DEFAULT 0x00000000 +#define RPC_NCA_FLAGS_IDEMPOTENT 0x00000001 +#define RPC_NCA_FLAGS_BROADCAST 0x00000002 +#define RPC_NCA_FLAGS_MAYBE 0x00000004 + typedef void (__RPC_STUB *RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message); typedef struct
1
0
0
0
Alexandre Julliard : winecoreaudio: Fixed a bunch of compiler warnings.
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: 11fe65746625afcede3cb26c6dbd22b11fae9751 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=11fe65746625afcede3cb26…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 31 14:52:58 2006 +0200 winecoreaudio: Fixed a bunch of compiler warnings. --- dlls/winmm/winecoreaudio/audio.c | 87 +++++++--------------------------- dlls/winmm/winecoreaudio/audiounit.c | 29 ++--------- 2 files changed, 25 insertions(+), 91 deletions(-) diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c index 52c880b..7c43d95 100644 --- a/dlls/winmm/winecoreaudio/audio.c +++ b/dlls/winmm/winecoreaudio/audio.c @@ -96,8 +96,8 @@ typedef struct tagCoreAudio_Device { unsigned open_count; char* interface_name; - WAVEOUTCAPSA out_caps; - WAVEINCAPSA in_caps; + WAVEOUTCAPSW out_caps; + WAVEINCAPSW in_caps; DWORD in_caps_support; int sample_rate; int stereo; @@ -170,17 +170,13 @@ typedef struct { } WINE_WAVEIN; static WINE_WAVEOUT WOutDev [MAX_WAVEOUTDRV]; -static WINE_WAVEIN WInDev [MAX_WAVEINDRV ]; - -static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); -static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); static LPWAVEHDR wodHelper_PlayPtrNext(WINE_WAVEOUT* wwo); static DWORD wodHelper_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force); extern int AudioUnit_CreateDefaultAudioUnit(void *wwo, AudioUnit *au); extern int AudioUnit_CloseAudioUnit(AudioUnit au); -extern int AudioUnit_InitializeWithStreamDescription(AudioUnit au, AudioStreamBasicDescription streamFormat); +extern int AudioUnit_InitializeWithStreamDescription(AudioUnit au, AudioStreamBasicDescription *streamFormat); extern OSStatus AudioOutputUnitStart(AudioUnit au); extern OSStatus AudioOutputUnitStop(AudioUnit au); @@ -277,7 +273,7 @@ static CFDataRef wodMessageHandler(CFMes return NULL; } -static DWORD messageThread(LPVOID p) +static DWORD WINAPI messageThread(LPVOID p) { CFMessagePortRef local; CFRunLoopSourceRef source; @@ -312,7 +308,7 @@ static DWORD wodSendDriverCallbackMessag buffer[2] = (UInt32) dwParam1; buffer[3] = (UInt32) dwParam2; - data = CFDataCreate(kCFAllocatorDefault, buffer, sizeof(UInt32) * 4); + data = CFDataCreate(kCFAllocatorDefault, (UInt8 *)buffer, sizeof(UInt32) * 4); if (!data) { CFAllocatorDeallocate(NULL, buffer); @@ -410,8 +406,8 @@ BOOL CoreAudio_GetDevCaps (void) } TRACE("Device Stream Description mSampleRate : %f\n mFormatID : %c%c%c%c\n" - "mFormatFlags : %lX\n mBytesPerPacket : %u\n mFramesPerPacket : %u\n" - "mBytesPerFrame : %u\n mChannelsPerFrame : %u\n mBitsPerChannel : %u\n", + "mFormatFlags : %lX\n mBytesPerPacket : %lu\n mFramesPerPacket : %lu\n" + "mBytesPerFrame : %lu\n mChannelsPerFrame : %lu\n mBitsPerChannel : %lu\n", CoreAudio_DefaultDevice.streamDescription.mSampleRate, (char) (CoreAudio_DefaultDevice.streamDescription.mFormatID >> 24), (char) (CoreAudio_DefaultDevice.streamDescription.mFormatID >> 16), @@ -457,7 +453,7 @@ LONG CoreAudio_WaveInit(void) /* number of sound cards */ AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propertySize, NULL); propertySize /= sizeof(AudioDeviceID); - TRACE("sound cards : %u\n", propertySize); + TRACE("sound cards : %lu\n", propertySize); /* Get the output device */ propertySize = sizeof(CoreAudio_DefaultDevice.outputDeviceID); @@ -528,11 +524,11 @@ LONG CoreAudio_WaveInit(void) void CoreAudio_WaveRelease(void) { - TRACE("()\n"); - /* Stop CFRunLoop in messageThread */ CFMessagePortRef messagePort; - + + TRACE("()\n"); + messagePort = CFMessagePortCreateRemote(kCFAllocatorDefault, CFSTR("WaveMessagePort")); CFMessagePortSendRequest(messagePort, kStopLoopMessage, NULL, 0.0, 0.0, NULL, NULL); CFRelease(messagePort); @@ -604,8 +600,8 @@ static DWORD wodOpen(WORD wDevID, LPWAVE WINE_WAVEOUT* wwo; DWORD retval; DWORD ret; - int audio_fragment; - + AudioStreamBasicDescription streamFormat; + TRACE("(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags); if (lpDesc == NULL) { @@ -656,14 +652,12 @@ static DWORD wodOpen(WORD wDevID, LPWAVE pthread_mutex_init(&wwo->lock, NULL); /* initialize the mutex */ pthread_mutex_lock(&wwo->lock); - - AudioStreamBasicDescription streamFormat; - + streamFormat.mFormatID = kAudioFormatLinearPCM; /* FIXME check for 32bits float -> kLinearPCMFormatFlagIsFloat */ streamFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger -# ifdef __powerpc__ +# ifdef WORDS_BIGENDIAN | kLinearPCMFormatFlagIsBigEndian /* FIXME Wave format is little endian */ # endif | kLinearPCMFormatFlagIsPacked; @@ -674,8 +668,8 @@ # endif streamFormat.mBitsPerChannel = lpDesc->lpFormat->wBitsPerSample; streamFormat.mBytesPerFrame = streamFormat.mBitsPerChannel * streamFormat.mChannelsPerFrame / 8; streamFormat.mBytesPerPacket = streamFormat.mBytesPerFrame * streamFormat.mFramesPerPacket; - - ret = AudioUnit_InitializeWithStreamDescription(wwo->audioUnit, streamFormat); + + ret = AudioUnit_InitializeWithStreamDescription(wwo->audioUnit, &streamFormat); if (!ret) { pthread_mutex_unlock(&wwo->lock); @@ -1124,8 +1118,7 @@ static DWORD wodGetPosition(WORD wDevID, { DWORD val; WINE_WAVEOUT* wwo; - DWORD elapsedMS; - + TRACE("(%u, %p, %lu);\n", wDevID, lpTime, uSize); if (wDevID >= MAX_WAVEOUTDRV) @@ -1147,31 +1140,6 @@ static DWORD wodGetPosition(WORD wDevID, } /************************************************************************** -* wodBreakLoop [internal] -*/ -static DWORD wodBreakLoop(WORD wDevID) -{ - FIXME("(%u);\n", wDevID); - - if (wDevID >= MAX_WAVEOUTDRV) - { - WARN("bad device ID !\n"); - return MMSYSERR_BADDEVICEID; - } - pthread_mutex_lock(&WOutDev[wDevID].lock); - - if (WOutDev[wDevID].state == WINE_WS_PLAYING && WOutDev[wDevID].lpLoopPtr != NULL) - { - /* ensure exit at end of current loop */ - WOutDev[wDevID].dwLoops = 1; - } - - pthread_mutex_unlock(&WOutDev[wDevID].lock); - - return MMSYSERR_NOERROR; -} - -/************************************************************************** * wodGetVolume [internal] */ static DWORD wodGetVolume(WORD wDevID, LPDWORD lpdwVol) @@ -1185,7 +1153,7 @@ static DWORD wodGetVolume(WORD wDevID, L return MMSYSERR_BADDEVICEID; } - TRACE("(%u, %08lX);\n", wDevID, lpdwVol); + TRACE("(%u, %p);\n", wDevID, lpdwVol); pthread_mutex_lock(&WOutDev[wDevID].lock); @@ -1341,23 +1309,6 @@ struct IDsDriverBufferImpl DWORD buflen; }; -static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv) -{ - /* we can't perform memory mapping as we don't have a file stream - interface with jack like we do with oss */ - MESSAGE("This sound card's driver does not support direct access\n"); - MESSAGE("The (slower) DirectSound HEL mode will be used instead.\n"); - return MMSYSERR_NOTSUPPORTED; -} - -static DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) -{ - memset(desc, 0, sizeof(*desc)); - strcpy(desc->szDesc, "Wine CoreAudio DirectSound Driver"); - strcpy(desc->szDrvname, "winecoreaudio.drv"); - return MMSYSERR_NOERROR; -} - /* CoreAudio IO threaded callback, diff --git a/dlls/winmm/winecoreaudio/audiounit.c b/dlls/winmm/winecoreaudio/audiounit.c index b9ac57c..b548025 100644 --- a/dlls/winmm/winecoreaudio/audiounit.c +++ b/dlls/winmm/winecoreaudio/audiounit.c @@ -26,24 +26,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wave); #ifdef HAVE_AUDIOUNIT_AUDIOUNIT_H #include <AudioUnit/AudioUnit.h> -static char streamStr[512] = {0}; -static char *streamDescription(AudioStreamBasicDescription stream) -{ - sprintf(streamStr, "\n mSampleRate : %f\n mFormatID : %c%c%c%c\n mFormatFlags : %lX\n mBytesPerPacket : %u\n mFramesPerPacket : %u\n mBytesPerFrame : %u\n mChannelsPerFrame : %u\n mBitsPerChannel : %u\n", - stream.mSampleRate, - (char) (stream.mFormatID >> 24), - (char) (stream.mFormatID >> 16), - (char) (stream.mFormatID >> 8), - (char) stream.mFormatID, - stream.mFormatFlags, - stream.mBytesPerPacket, - stream.mFramesPerPacket, - stream.mBytesPerFrame, - stream.mChannelsPerFrame, - stream.mBitsPerChannel); - return streamStr; -} - extern OSStatus CoreAudio_woAudioUnitIOProc(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, @@ -54,6 +36,7 @@ extern OSStatus CoreAudio_woAudioUnitIOP int AudioUnit_CreateDefaultAudioUnit(void *wwo, AudioUnit *au) { OSStatus err; + Component comp; ComponentDescription desc; AURenderCallbackStruct callbackStruct; @@ -62,8 +45,8 @@ int AudioUnit_CreateDefaultAudioUnit(voi desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; - - Component comp = FindNextComponent(NULL, &desc); + + comp = FindNextComponent(NULL, &desc); if (comp == NULL) return 0; @@ -89,13 +72,13 @@ int AudioUnit_CloseAudioUnit(AudioUnit a return (err == noErr); } -int AudioUnit_InitializeWithStreamDescription(AudioUnit au, AudioStreamBasicDescription stream) +int AudioUnit_InitializeWithStreamDescription(AudioUnit au, AudioStreamBasicDescription *stream) { OSStatus err = noErr; err = AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, - 0, &stream, sizeof(AudioStreamBasicDescription)); - + 0, stream, sizeof(*stream)); + if (err != noErr) { ERR("AudioUnitSetProperty return an error %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err);
1
0
0
0
Alexandre Julliard : dnsapi: Added check for _msg_ptr vs. _ptr member in ns_msg struct.
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: 788e30f13964030e5174106fee41ed58f43c0196 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=788e30f13964030e5174106…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 31 14:43:21 2006 +0200 dnsapi: Added check for _msg_ptr vs. _ptr member in ns_msg struct. --- configure | 129 ++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 12 ++++ dlls/dnsapi/ns_parse.c | 36 ++++++++----- include/config.h.in | 3 + 4 files changed, 165 insertions(+), 15 deletions(-) diff --git a/configure b/configure index fda555c..3048ccd 100755 --- a/configure +++ b/configure @@ -20742,6 +20742,135 @@ _ACEOF fi +{ echo "$as_me:$LINENO: checking for ns_msg._msg_ptr" >&5 +echo $ECHO_N "checking for ns_msg._msg_ptr... $ECHO_C" >&6; } +if test "${ac_cv_member_ns_msg__msg_ptr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include <arpa/nameser.h> +#endif + +int +main () +{ +static ns_msg ac_aggr; +if (ac_aggr._msg_ptr) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_ns_msg__msg_ptr=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include <arpa/nameser.h> +#endif + +int +main () +{ +static ns_msg ac_aggr; +if (sizeof ac_aggr._msg_ptr) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_ns_msg__msg_ptr=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_ns_msg__msg_ptr=no +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_ns_msg__msg_ptr" >&5 +echo "${ECHO_T}$ac_cv_member_ns_msg__msg_ptr" >&6; } +if test $ac_cv_member_ns_msg__msg_ptr = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_NS_MSG__MSG_PTR 1 +_ACEOF + + +fi + + { echo "$as_me:$LINENO: checking for timezone variable" >&5 echo $ECHO_N "checking for timezone variable... $ECHO_C" >&6; } if test "${ac_cv_have_timezone+set}" = set; then diff --git a/configure.ac b/configure.ac index d60099d..b248757 100644 --- a/configure.ac +++ b/configure.ac @@ -1455,6 +1455,18 @@ #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif]) +dnl Check for ns_msg ptr member +AC_CHECK_MEMBERS([ns_msg._msg_ptr],,, +[#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include <arpa/nameser.h> +#endif]) + dnl Check for the external timezone variables timezone and daylight AC_CACHE_CHECK([for timezone variable], ac_cv_have_timezone, AC_TRY_LINK([#include <time.h>],[timezone;], diff --git a/dlls/dnsapi/ns_parse.c b/dlls/dnsapi/ns_parse.c index b84e242..7d76428 100644 --- a/dlls/dnsapi/ns_parse.c +++ b/dlls/dnsapi/ns_parse.c @@ -40,6 +40,12 @@ static void setsection(ns_msg *msg, ns_s #define RETERR(err) do { return (-1); } while (0) +#ifdef HAVE_NS_MSG__MSG_PTR +# define NS_PTR(ns_msg) ((ns_msg)->_msg_ptr) +#else +# define NS_PTR(ns_msg) ((ns_msg)->_ptr) +#endif + /* Public. */ static int @@ -121,38 +127,38 @@ dns_ns_parserr(ns_msg *handle, ns_sect s if (rrnum < handle->_rrnum) setsection(handle, section); if (rrnum > handle->_rrnum) { - b = dns_ns_skiprr(handle->_ptr, handle->_eom, section, + b = dns_ns_skiprr(NS_PTR(handle), handle->_eom, section, rrnum - handle->_rrnum); if (b < 0) return (-1); - handle->_ptr += b; + NS_PTR(handle) += b; handle->_rrnum = rrnum; } /* Do the parse. */ b = dn_expand(handle->_msg, handle->_eom, - handle->_ptr, rr->name, NS_MAXDNAME); + NS_PTR(handle), rr->name, NS_MAXDNAME); if (b < 0) return (-1); - handle->_ptr += b; - if (handle->_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom) + NS_PTR(handle) += b; + if (NS_PTR(handle) + NS_INT16SZ + NS_INT16SZ > handle->_eom) RETERR(EMSGSIZE); - NS_GET16(rr->type, handle->_ptr); - NS_GET16(rr->rr_class, handle->_ptr); + NS_GET16(rr->type, NS_PTR(handle)); + NS_GET16(rr->rr_class, NS_PTR(handle)); if (section == ns_s_qd) { rr->ttl = 0; rr->rdlength = 0; rr->rdata = NULL; } else { - if (handle->_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom) + if (NS_PTR(handle) + NS_INT32SZ + NS_INT16SZ > handle->_eom) RETERR(EMSGSIZE); - NS_GET32(rr->ttl, handle->_ptr); - NS_GET16(rr->rdlength, handle->_ptr); - if (handle->_ptr + rr->rdlength > handle->_eom) + NS_GET32(rr->ttl, NS_PTR(handle)); + NS_GET16(rr->rdlength, NS_PTR(handle)); + if (NS_PTR(handle) + rr->rdlength > handle->_eom) RETERR(EMSGSIZE); - rr->rdata = handle->_ptr; - handle->_ptr += rr->rdlength; + rr->rdata = NS_PTR(handle); + NS_PTR(handle) += rr->rdlength; } if (++handle->_rrnum > handle->_counts[(int)section]) setsection(handle, (ns_sect)((int)section + 1)); @@ -168,9 +174,9 @@ setsection(ns_msg *msg, ns_sect sect) { msg->_sect = sect; if (sect == ns_s_max) { msg->_rrnum = -1; - msg->_ptr = NULL; + NS_PTR(msg) = NULL; } else { msg->_rrnum = 0; - msg->_ptr = msg->_sections[(int)sect]; + NS_PTR(msg) = msg->_sections[(int)sect]; } } diff --git a/include/config.h.in b/include/config.h.in index c3752c6..3978aee 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -476,6 +476,9 @@ #undef HAVE_NET_IF_TYPES_H /* Define to 1 if you have the <net/route.h> header file. */ #undef HAVE_NET_ROUTE_H +/* Define to 1 if `_msg_ptr' is member of `ns_msg'. */ +#undef HAVE_NS_MSG__MSG_PTR + /* Define to 1 if the system has the type `off_t'. */ #undef HAVE_OFF_T
1
0
0
0
Alexandre Julliard : dnsapi: Remove a bunch of unused functions that cause naming conflicts.
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: d1a3383d531664af984c5245c5916228322653f2 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=d1a3383d531664af984c524…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 31 14:25:49 2006 +0200 dnsapi: Remove a bunch of unused functions that cause naming conflicts. --- dlls/dnsapi/ns_name.c | 264 ------------------------------------------------ dlls/dnsapi/ns_parse.c | 28 +---- dlls/dnsapi/query.c | 5 + 3 files changed, 7 insertions(+), 290 deletions(-) diff --git a/dlls/dnsapi/ns_name.c b/dlls/dnsapi/ns_name.c index e7d866d..542ea1b 100644 --- a/dlls/dnsapi/ns_name.c +++ b/dlls/dnsapi/ns_name.c @@ -42,9 +42,6 @@ static const char digits[] = "0123456789 static int special(int); static int printable(int); -static int dn_find(const u_char *, const u_char *, - const u_char * const *, - const u_char * const *); /* Public. */ @@ -271,46 +268,6 @@ dns_ns_name_pton(const char *src, u_char return (0); } -/* - * ns_name_ntol(src, dst, dstsiz) - * Convert a network strings labels into all lowercase. - * return: - * Number of bytes written to buffer, or -1 (with errno set) - * notes: - * Enforces label and domain length limits. - */ - -int -ns_name_ntol(const u_char *src, u_char *dst, size_t dstsiz) { - const u_char *cp; - u_char *dn, *eom; - u_char c; - u_int n; - - cp = src; - dn = dst; - eom = dst + dstsiz; - - while ((n = *cp++) != 0) { - if ((n & NS_CMPRSFLGS) != 0) { - /* Some kind of compression pointer. */ - return (-1); - } - *dn++ = n; - if (dn + n >= eom) { - return (-1); - } - for ((void)NULL; n > 0; n--) { - c = *cp++; - if (isupper(c)) - *dn++ = tolower(c); - else - *dn++ = c; - } - } - *dn++ = '\0'; - return (dn - dst); -} /* * dns_ns_name_unpack(msg, eom, src, dst, dstsiz) @@ -392,111 +349,6 @@ dns_ns_name_unpack(const u_char *msg, co return (len); } -/* - * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr) - * Pack domain name 'domain' into 'comp_dn'. - * return: - * Size of the compressed name, or -1. - * notes: - * 'dnptrs' is an array of pointers to previous compressed names. - * dnptrs[0] is a pointer to the beginning of the message. The array - * ends with NULL. - * 'lastdnptr' is a pointer to the end of the array pointed to - * by 'dnptrs'. - * Side effects: - * The list of pointers in dnptrs is updated for labels inserted into - * the message as we compress the name. If 'dnptr' is NULL, we don't - * try to compress names. If 'lastdnptr' is NULL, we don't update the - * list. - */ -int -ns_name_pack(const u_char *src, u_char *dst, int dstsiz, - const u_char **dnptrs, const u_char **lastdnptr) -{ - u_char *dstp; - const u_char **cpp, **lpp, *eob, *msg; - const u_char *srcp; - int n, l, first = 1; - - srcp = src; - dstp = dst; - eob = dstp + dstsiz; - lpp = cpp = NULL; - if (dnptrs != NULL) { - if ((msg = *dnptrs++) != NULL) { - for (cpp = dnptrs; *cpp != NULL; cpp++) - (void)NULL; - lpp = cpp; /* end of list to search */ - } - } else - msg = NULL; - - /* make sure the domain we are about to add is legal */ - l = 0; - do { - n = *srcp; - if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) { - return (-1); - } - if (n == 0x41) - n = *++srcp / 8; - l += n + 1; - if (l > NS_MAXCDNAME) { - return (-1); - } - srcp += n + 1; - } while (n != 0); - - /* from here on we need to reset compression pointer array on error */ - srcp = src; - do { - /* Look to see if we can use pointers. */ - n = *srcp; - if (n != 0 && n != 0x41 && msg != NULL) { - l = dn_find(srcp, msg, (const u_char * const *)dnptrs, - (const u_char * const *)lpp); - if (l >= 0) { - if (dstp + 1 >= eob) { - goto cleanup; - } - *dstp++ = (l >> 8) | NS_CMPRSFLGS; - *dstp++ = l % 256; - return (dstp - dst); - } - /* Not found, save it. */ - if (lastdnptr != NULL && cpp < lastdnptr - 1 && - (dstp - msg) < 0x4000 && first) { - *cpp++ = dstp; - *cpp = NULL; - first = 0; - } - } - /* copy label to buffer */ - if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) { /* Should not happen. */ - goto cleanup; - } - if (n == 0x41) { - n = *++srcp / 8; - if (dstp + 1 >= eob) - goto cleanup; - *dstp++ = 0x41; - } - if (dstp + 1 + n >= eob) { - goto cleanup; - } - memcpy(dstp, srcp, n + 1); - srcp += n + 1; - dstp += n + 1; - } while (n != 0); - - if (dstp > eob) { -cleanup: - if (msg != NULL) - *lpp = NULL; - return (-1); - } - return (dstp - dst); -} /* * dns_ns_name_uncompress(msg, eom, src, dst, dstsiz) @@ -520,47 +372,6 @@ dns_ns_name_uncompress(const u_char *msg return (n); } -/* - * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr) - * Compress a domain name into wire format, using compression pointers. - * return: - * Number of bytes consumed in `dst' or -1 (with errno set). - * notes: - * 'dnptrs' is an array of pointers to previous compressed names. - * dnptrs[0] is a pointer to the beginning of the message. - * The list ends with NULL. 'lastdnptr' is a pointer to the end of the - * array pointed to by 'dnptrs'. Side effect is to update the list of - * pointers for labels inserted into the message as we compress the name. - * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr' - * is NULL, we don't update the list. - */ -int -ns_name_compress(const char *src, u_char *dst, size_t dstsiz, - const u_char **dnptrs, const u_char **lastdnptr) -{ - u_char tmp[NS_MAXCDNAME]; - - if (dns_ns_name_pton(src, tmp, sizeof tmp) == -1) - return (-1); - return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr)); -} - -/* - * Reset dnptrs so that there are no active references to pointers at or - * after src. - */ -void -ns_name_rollback(const u_char *src, const u_char **dnptrs, - const u_char **lastdnptr) -{ - while (dnptrs < lastdnptr && *dnptrs != NULL) { - if (*dnptrs >= src) { - *dnptrs = NULL; - break; - } - dnptrs++; - } -} /* * dns_ns_name_skip(ptrptr, eom) @@ -631,78 +442,3 @@ static int printable(int ch) { return (ch > 0x20 && ch < 0x7f); } - -/* - * Thinking in noninternationalized USASCII (per the DNS spec), - * convert this character to lower case if it's upper case. - */ -static int -mklower(int ch) { - if (ch >= 0x41 && ch <= 0x5A) - return (ch + 0x20); - return (ch); -} - -/* - * dn_find(domain, msg, dnptrs, lastdnptr) - * Search for the counted-label name in an array of compressed names. - * return: - * offset from msg if found, or -1. - * notes: - * dnptrs is the pointer to the first name on the list, - * not the pointer to the start of the message. - */ -static int -dn_find(const u_char *domain, const u_char *msg, - const u_char * const *dnptrs, - const u_char * const *lastdnptr) -{ - const u_char *dn, *cp, *sp; - const u_char * const *cpp; - u_int n; - - for (cpp = dnptrs; cpp < lastdnptr; cpp++) { - sp = *cpp; - /* - * terminate search on: - * root label - * compression pointer - * unusable offset - */ - while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 && - (sp - msg) < 0x4000) { - dn = domain; - cp = sp; - while ((n = *cp++) != 0) { - /* - * check for indirection - */ - switch (n & NS_CMPRSFLGS) { - case 0: /* normal case, n == len */ - if (n != *dn++) - goto next; - for ((void)NULL; n > 0; n--) - if (mklower(*dn++) != - mklower(*cp++)) - goto next; - /* Is next root for both ? */ - if (*dn == '\0' && *cp == '\0') - return (sp - msg); - if (*dn) - continue; - goto next; - - case NS_CMPRSFLGS: /* indirection */ - cp = msg + (((n & 0x3f) << 8) | *cp); - break; - - default: /* illegal type */ - return (-1); - } - } - next: - sp += *sp + 1; - } - } - return (-1); -} diff --git a/dlls/dnsapi/ns_parse.c b/dlls/dnsapi/ns_parse.c index e9a15ac..b84e242 100644 --- a/dlls/dnsapi/ns_parse.c +++ b/dlls/dnsapi/ns_parse.c @@ -42,28 +42,8 @@ #define RETERR(err) do { return (-1); } /* Public. */ -/* These need to be in the same order as the nres.h:ns_flag enum. */ -struct _ns_flagdata _ns_flagdata[16] = { - { 0x8000, 15 }, /* qr. */ - { 0x7800, 11 }, /* opcode. */ - { 0x0400, 10 }, /* aa. */ - { 0x0200, 9 }, /* tc. */ - { 0x0100, 8 }, /* rd. */ - { 0x0080, 7 }, /* ra. */ - { 0x0040, 6 }, /* z. */ - { 0x0020, 5 }, /* ad. */ - { 0x0010, 4 }, /* cd. */ - { 0x000f, 0 }, /* rcode. */ - { 0x0000, 0 }, /* expansion (1/6). */ - { 0x0000, 0 }, /* expansion (2/6). */ - { 0x0000, 0 }, /* expansion (3/6). */ - { 0x0000, 0 }, /* expansion (4/6). */ - { 0x0000, 0 }, /* expansion (5/6). */ - { 0x0000, 0 }, /* expansion (6/6). */ -}; - -int -ns_skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) { +static int +dns_ns_skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) { const u_char *optr = ptr; for ((void)NULL; count > 0; count--) { @@ -109,7 +89,7 @@ dns_ns_initparse(const u_char *msg, int if (handle->_counts[i] == 0) handle->_sections[i] = NULL; else { - int b = ns_skiprr(msg, eom, (ns_sect)i, + int b = dns_ns_skiprr(msg, eom, (ns_sect)i, handle->_counts[i]); if (b < 0) @@ -141,7 +121,7 @@ dns_ns_parserr(ns_msg *handle, ns_sect s if (rrnum < handle->_rrnum) setsection(handle, section); if (rrnum > handle->_rrnum) { - b = ns_skiprr(handle->_ptr, handle->_eom, section, + b = dns_ns_skiprr(handle->_ptr, handle->_eom, section, rrnum - handle->_rrnum); if (b < 0) diff --git a/dlls/dnsapi/query.c b/dlls/dnsapi/query.c index 185a21f..3af529e 100644 --- a/dlls/dnsapi/query.c +++ b/dlls/dnsapi/query.c @@ -541,9 +541,10 @@ static DNS_STATUS dns_do_query( PCSTR na goto exit; } - if (ns_msg_getflag( msg, ns_f_rcode ) != ns_r_noerror) +#define RCODE_MASK 0x0f + if ((msg._flags & RCODE_MASK) != ns_r_noerror) { - ret = dns_map_error( ns_msg_getflag( msg, ns_f_rcode ) ); + ret = dns_map_error( msg._flags & RCODE_MASK ); goto exit; }
1
0
0
0
Alexandre Julliard : dnsapi: Portability fixes.
by Alexandre Julliard
31 May '06
31 May '06
Module: wine Branch: refs/heads/master Commit: 826cc602d54d93d348d1868c51a340703b37e464 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=826cc602d54d93d348d1868…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 31 14:17:04 2006 +0200 dnsapi: Portability fixes. --- dlls/dnsapi/ns_name.c | 6 +-- dlls/dnsapi/query.c | 100 +++++++++++++++++++++++++------------------------ 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/dlls/dnsapi/ns_name.c b/dlls/dnsapi/ns_name.c index 0c7c24d..e7d866d 100644 --- a/dlls/dnsapi/ns_name.c +++ b/dlls/dnsapi/ns_name.c @@ -235,7 +235,7 @@ dns_ns_name_pton(const char *src, u_char } *bp++ = '\0'; } - if ((bp - dst) > MAXCDNAME) { + if ((bp - dst) > NS_MAXCDNAME) { return (-1); } return (1); @@ -265,7 +265,7 @@ dns_ns_name_pton(const char *src, u_char } *bp++ = 0; } - if ((bp - dst) > MAXCDNAME) { /* src too big */ + if ((bp - dst) > NS_MAXCDNAME) { /* src too big */ return (-1); } return (0); @@ -441,7 +441,7 @@ ns_name_pack(const u_char *src, u_char * if (n == 0x41) n = *++srcp / 8; l += n + 1; - if (l > MAXCDNAME) { + if (l > NS_MAXCDNAME) { return (-1); } srcp += n + 1; diff --git a/dlls/dnsapi/query.c b/dlls/dnsapi/query.c index 9bdd706..185a21f 100644 --- a/dlls/dnsapi/query.c +++ b/dlls/dnsapi/query.c @@ -125,17 +125,17 @@ static DNS_STATUS dns_map_error( int err { switch (error) { - case NOERROR: return ERROR_SUCCESS; - case FORMERR: return DNS_ERROR_RCODE_FORMAT_ERROR; - case SERVFAIL: return DNS_ERROR_RCODE_SERVER_FAILURE; - case NXDOMAIN: return DNS_ERROR_RCODE_NAME_ERROR; - case NOTIMP: return DNS_ERROR_RCODE_NOT_IMPLEMENTED; - case REFUSED: return DNS_ERROR_RCODE_REFUSED; - case YXDOMAIN: return DNS_ERROR_RCODE_YXDOMAIN; - case YXRRSET: return DNS_ERROR_RCODE_YXRRSET; - case NXRRSET: return DNS_ERROR_RCODE_NXRRSET; - case NOTAUTH: return DNS_ERROR_RCODE_NOTAUTH; - case NOTZONE: return DNS_ERROR_RCODE_NOTZONE; + case ns_r_noerror: return ERROR_SUCCESS; + case ns_r_formerr: return DNS_ERROR_RCODE_FORMAT_ERROR; + case ns_r_servfail: return DNS_ERROR_RCODE_SERVER_FAILURE; + case ns_r_nxdomain: return DNS_ERROR_RCODE_NAME_ERROR; + case ns_r_notimpl: return DNS_ERROR_RCODE_NOT_IMPLEMENTED; + case ns_r_refused: return DNS_ERROR_RCODE_REFUSED; + case ns_r_yxdomain: return DNS_ERROR_RCODE_YXDOMAIN; + case ns_r_yxrrset: return DNS_ERROR_RCODE_YXRRSET; + case ns_r_nxrrset: return DNS_ERROR_RCODE_NXRRSET; + case ns_r_notauth: return DNS_ERROR_RCODE_NOTAUTH; + case ns_r_notzone: return DNS_ERROR_RCODE_NOTZONE; default: FIXME( "unmapped error code: %d\n", error ); return DNS_ERROR_RCODE_NOT_IMPLEMENTED; @@ -193,23 +193,23 @@ static unsigned int dns_get_record_size( switch (rr->type) { - case T_KEY: + case ns_t_key: { pos += sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE); size += rr->rdata + rr->rdlength - pos - 1; break; } - case T_SIG: + case ns_t_sig: { pos += sizeof(PCHAR) + sizeof(WORD) + 2 * sizeof(BYTE); pos += 3 * sizeof(DWORD) + 2 * sizeof(WORD); size += rr->rdata + rr->rdlength - pos - 1; break; } - case T_HINFO: - case T_ISDN: - case T_TXT: - case T_X25: + case ns_t_hinfo: + case ns_t_isdn: + case ns_t_txt: + case ns_t_x25: { while (pos[0] && pos < rr->rdata + rr->rdlength) { @@ -219,13 +219,13 @@ static unsigned int dns_get_record_size( size += (num - 1) * sizeof(PCHAR); break; } - case T_NULL: + case ns_t_null: { size += rr->rdlength - 1; break; } - case T_NXT: - case T_WKS: + case ns_t_nxt: + case ns_t_wks: case 0xff01: /* WINS */ { FIXME( "unhandled type: %s\n", dns_type_to_str( rr->type ) ); @@ -245,13 +245,13 @@ static DNS_STATUS dns_copy_rdata( ns_msg switch (rr->type) { - case T_A: + case ns_t_a: { r->Data.A.IpAddress = *(DWORD *)pos; *dlen = sizeof(DNS_A_DATA); break; } - case T_AAAA: + case ns_t_aaaa: { for (i = 0; i < sizeof(IP6_ADDRESS)/sizeof(DWORD); i++) { @@ -262,7 +262,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_AAAA_DATA); break; } - case T_KEY: + case ns_t_key: { /* FIXME: byte order? */ r->Data.KEY.wFlags = *(WORD *)pos; pos += sizeof(WORD); @@ -277,8 +277,8 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_KEY_DATA) + (size - 1) * sizeof(BYTE); break; } - case T_RP: - case T_MINFO: + case ns_t_rp: + case ns_t_minfo: { r->Data.MINFO.pNameMailbox = dns_dname_from_msg( msg, pos ); if (!r->Data.MINFO.pNameMailbox) return ERROR_NOT_ENOUGH_MEMORY; @@ -296,9 +296,9 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_MINFO_DATAA); break; } - case T_AFSDB: - case T_RT: - case T_MX: + case ns_t_afsdb: + case ns_t_rt: + case ns_t_mx: { r->Data.MX.wPreference = ntohs( *(WORD *)pos ); r->Data.MX.pNameExchange = dns_dname_from_msg( msg, pos + sizeof(WORD) ); @@ -307,7 +307,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_MX_DATAA); break; } - case T_NULL: + case ns_t_null: { r->Data.Null.dwByteCount = rr->rdlength; memcpy( r->Data.Null.Data, rr->rdata, rr->rdlength ); @@ -315,14 +315,14 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_NULL_DATA) + rr->rdlength - 1; break; } - case T_CNAME: - case T_NS: - case T_MB: - case T_MD: - case T_MF: - case T_MG: - case T_MR: - case T_PTR: + case ns_t_cname: + case ns_t_ns: + case ns_t_mb: + case ns_t_md: + case ns_t_mf: + case ns_t_mg: + case ns_t_mr: + case ns_t_ptr: { r->Data.PTR.pNameHost = dns_dname_from_msg( msg, pos ); if (!r->Data.PTR.pNameHost) return ERROR_NOT_ENOUGH_MEMORY; @@ -330,7 +330,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_PTR_DATAA); break; } - case T_SIG: + case ns_t_sig: { r->Data.SIG.pNameSigner = dns_dname_from_msg( msg, pos ); if (!r->Data.SIG.pNameSigner) return ERROR_NOT_ENOUGH_MEMORY; @@ -355,7 +355,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_SIG_DATAA) + (size - 1) * sizeof(BYTE); break; } - case T_SOA: + case ns_t_soa: { r->Data.SOA.pNamePrimaryServer = dns_dname_from_msg( msg, pos ); if (!r->Data.SOA.pNamePrimaryServer) return ERROR_NOT_ENOUGH_MEMORY; @@ -382,7 +382,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_SOA_DATAA); break; } - case T_SRV: + case ns_t_srv: { r->Data.SRV.wPriority = ntohs( *(WORD *)pos ); pos += sizeof(WORD); r->Data.SRV.wWeight = ntohs( *(WORD *)pos ); pos += sizeof(WORD); @@ -394,10 +394,10 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_SRV_DATAA); break; } - case T_HINFO: - case T_ISDN: - case T_X25: - case T_TXT: + case ns_t_hinfo: + case ns_t_isdn: + case ns_t_x25: + case ns_t_txt: { i = 0; while (pos[0] && pos < rr->rdata + rr->rdlength) @@ -416,11 +416,11 @@ static DNS_STATUS dns_copy_rdata( ns_msg *dlen = sizeof(DNS_TXT_DATAA) + (i - 1) * sizeof(PCHAR); break; } - case T_ATMA: - case T_LOC: - case T_NXT: - case T_TSIG: - case T_WKS: + case ns_t_atma: + case ns_t_loc: + case ns_t_nxt: + case ns_t_tsig: + case ns_t_wks: case 0x00f9: /* TKEY */ case 0xff01: /* WINS */ case 0xff02: /* WINSR */ @@ -528,7 +528,7 @@ static DNS_STATUS dns_do_query( PCSTR na DNS_RRSET_INIT( rrset ); - len = __res_query( name, C_IN, type, answer, sizeof(answer) ); + len = res_query( name, ns_c_in, type, answer, sizeof(answer) ); if (len < 0) { ret = dns_map_h_errno( h_errno );
1
0
0
0
← Newer
1
2
3
4
...
87
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
Results per page:
10
25
50
100
200