ReactOS.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
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
List overview
Download
Ros-diffs
March 2010
----- 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
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[tkreuzer] 46510: [FREELDR] - Add a missing cast
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 28 05:06:50 2010 New Revision: 46510 URL:
http://svn.reactos.org/svn/reactos?rev=46510&view=rev
Log: [FREELDR] - Add a missing cast Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/peloader.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/peloader.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/peloader.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/peloader.c [iso-8859-1] Sun Mar 28 05:06:50 2010 @@ -573,7 +573,7 @@ High = ExportDirectory->NumberOfNames - 1; DPRINTM(DPRINT_PELOADER, "WinLdrpBindImportName() looking up import '%s' in #0..#%d\n", - VaToPa(&((PIMAGE_IMPORT_BY_NAME)VaToPa(ThunkData->u1.AddressOfData))->Name[0]), High); + VaToPa(&((PIMAGE_IMPORT_BY_NAME)VaToPa((PVOID)ThunkData->u1.AddressOfData))->Name[0]), High); /* Perform a binary-search loop */ while (High >= Low) @@ -586,7 +586,7 @@ (PCHAR)VaToPa(RVA(DllBase, NameTable[Middle]))); DPRINTM(DPRINT_PELOADER, "Binary search: comparing Import '%s', Export #%ld:'%s' -> %d\n", - VaToPa(&((PIMAGE_IMPORT_BY_NAME)VaToPa(ThunkData->u1.AddressOfData))->Name[0]), + VaToPa(&((PIMAGE_IMPORT_BY_NAME)VaToPa((PVOID)ThunkData->u1.AddressOfData))->Name[0]), Middle, (PCHAR)VaToPa(RVA(DllBase, NameTable[Middle])), Result); /*DPRINTM(DPRINT_PELOADER, "TE->u1.AOD %p, fulladdr %p\n",
14 years, 9 months
1
0
0
0
[tkreuzer] 46509: [DHCP] define NO_OLDNAMES to prevent redefinition
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 28 03:25:22 2010 New Revision: 46509 URL:
http://svn.reactos.org/svn/reactos?rev=46509&view=rev
Log: [DHCP] define NO_OLDNAMES to prevent redefinition Modified: branches/ros-amd64-bringup/reactos/base/services/dhcp/dhcp.rbuild Modified: branches/ros-amd64-bringup/reactos/base/services/dhcp/dhcp.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/base/…
============================================================================== --- branches/ros-amd64-bringup/reactos/base/services/dhcp/dhcp.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/base/services/dhcp/dhcp.rbuild [iso-8859-1] Sun Mar 28 03:25:22 2010 @@ -9,6 +9,7 @@ <define name="close">_close</define> <define name="read">_read</define> <define name="write">_write</define> + <define name="NO_OLDNAMES">1</define> <library>ntdll</library> <library>ws2_32</library>
14 years, 9 months
1
0
0
0
[jgardou] 46508: [WIN32K] Close another pair of DC_lockDc DC_UnlockDc.
by jgardou@svn.reactos.org
Author: jgardou Date: Sun Mar 28 01:51:25 2010 New Revision: 46508 URL:
http://svn.reactos.org/svn/reactos?rev=46508&view=rev
Log: [WIN32K] Close another pair of DC_lockDc DC_UnlockDc. Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dcobjs.c [iso-8859-1] Sun Mar 28 01:51:25 2010 @@ -352,6 +352,7 @@ if (pPath->state != PATH_Closed) { SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); + DC_UnlockDc(pdc); return FALSE; }
14 years, 9 months
1
0
0
0
[jgardou] 46507: [WIN32K] Each DC_lockDc call should be followed by a DC_UnlockDc, even on error path.
by jgardou@svn.reactos.org
Author: jgardou Date: Sun Mar 28 00:58:09 2010 New Revision: 46507 URL:
http://svn.reactos.org/svn/reactos?rev=46507&view=rev
Log: [WIN32K] Each DC_lockDc call should be followed by a DC_UnlockDc, even on error path. Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Sun Mar 28 00:58:09 2010 @@ -384,6 +384,7 @@ INT Index; PGDI_TABLE_ENTRY Entry; PDC pDC; + BOOL ret; /* FIXME: This function has broken error handling */ @@ -405,40 +406,43 @@ These regions do not use attribute sections and when allocated, use gdiobj level functions. */ - if (pDC->rosdc.hClipRgn) - { // FIXME! HAX!!! - Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hClipRgn); - Entry = &GdiHandleTable->Entries[Index]; - if (Entry->UserData) FreeObjectAttr(Entry->UserData); - Entry->UserData = NULL; - // - if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) return FALSE; - } - if (pDC->prgnVis) - { // FIXME! HAX!!! - Index = GDI_HANDLE_GET_INDEX(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr); - Entry = &GdiHandleTable->Entries[Index]; - if (Entry->UserData) FreeObjectAttr(Entry->UserData); - Entry->UserData = NULL; - // - if (!GDIOBJ_SetOwnership(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr, Owner)) return FALSE; - } - if (pDC->rosdc.hGCClipRgn) - { // FIXME! HAX!!! - Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hGCClipRgn); - Entry = &GdiHandleTable->Entries[Index]; - if (Entry->UserData) FreeObjectAttr(Entry->UserData); - Entry->UserData = NULL; - // - if (!GDIOBJ_SetOwnership(pDC->rosdc.hGCClipRgn, Owner)) return FALSE; - } - if (pDC->dclevel.hPath) - { - if (!GDIOBJ_SetOwnership(pDC->dclevel.hPath, Owner)) return FALSE; - } - DC_UnlockDc(pDC); - - return TRUE; + if (pDC->rosdc.hClipRgn) + { // FIXME! HAX!!! + Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hClipRgn); + Entry = &GdiHandleTable->Entries[Index]; + if (Entry->UserData) FreeObjectAttr(Entry->UserData); + Entry->UserData = NULL; + // + if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) goto leave; + } + if (pDC->prgnVis) + { // FIXME! HAX!!! + Index = GDI_HANDLE_GET_INDEX(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr); + Entry = &GdiHandleTable->Entries[Index]; + if (Entry->UserData) FreeObjectAttr(Entry->UserData); + Entry->UserData = NULL; + // + if (!GDIOBJ_SetOwnership(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr, Owner)) goto leave; + } + if (pDC->rosdc.hGCClipRgn) + { // FIXME! HAX!!! + Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hGCClipRgn); + Entry = &GdiHandleTable->Entries[Index]; + if (Entry->UserData) FreeObjectAttr(Entry->UserData); + Entry->UserData = NULL; + // + if (!GDIOBJ_SetOwnership(pDC->rosdc.hGCClipRgn, Owner)) goto leave; + } + if (pDC->dclevel.hPath) + { + if (!GDIOBJ_SetOwnership(pDC->dclevel.hPath, Owner)) goto leave; + } + ret = TRUE; + +leave: + DC_UnlockDc(pDC); + + return ret; } HDC Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] Sun Mar 28 00:58:09 2010 @@ -145,7 +145,6 @@ /* WTF? Internal error! */ DPRINT1("Could not lock the saved DC (%p) for dc %p!\n", hdcSave, pdc->BaseObject.hHmgr); - DC_UnlockDc(pdc); return;// FALSE; }
14 years, 9 months
1
0
0
0
[jgardou] 46506: svn will drive me nuts, part 2/2
by jgardou@svn.reactos.org
Author: jgardou Date: Sun Mar 28 00:52:07 2010 New Revision: 46506 URL:
http://svn.reactos.org/svn/reactos?rev=46506&view=rev
Log: svn will drive me nuts, part 2/2 Added: branches/reactos-yarotows/dll/directx/ksproxy/mediasample.cpp (with props) branches/reactos-yarotows/dll/nls/idndl/idndl.spec (with props) branches/reactos-yarotows/dll/win32/dbghelp/image_private.h (with props) branches/reactos-yarotows/dll/win32/rsaenh/sha2.c (with props) branches/reactos-yarotows/dll/win32/rsaenh/sha2.h (with props) Added: branches/reactos-yarotows/dll/directx/ksproxy/mediasample.cpp URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/dll/directx/ks…
============================================================================== --- branches/reactos-yarotows/dll/directx/ksproxy/mediasample.cpp (added) +++ branches/reactos-yarotows/dll/directx/ksproxy/mediasample.cpp [iso-8859-1] Sun Mar 28 00:52:07 2010 @@ -1,0 +1,368 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS WDM Streaming ActiveMovie Proxy + * FILE: dll/directx/ksproxy/mediasample.cpp + * PURPOSE: IMediaSample interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#include "precomp.h" + +class CMediaSample : public IMediaSample +{ +public: + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + DebugBreak(); + if (!m_Ref) + { + if (m_Allocator) + { + m_Allocator->ReleaseBuffer((IMediaSample*)this); + return 0; + } + delete this; + return 0; + } + return m_Ref; + } + + HRESULT STDMETHODCALLTYPE GetPointer(BYTE **ppBuffer); + long STDMETHODCALLTYPE GetSize(void); + HRESULT STDMETHODCALLTYPE GetTime(REFERENCE_TIME *pTimeStart, REFERENCE_TIME *pTimeEnd); + HRESULT STDMETHODCALLTYPE SetTime(REFERENCE_TIME *pTimeStart, REFERENCE_TIME *pTimeEnd); + HRESULT STDMETHODCALLTYPE IsSyncPoint(); + HRESULT STDMETHODCALLTYPE SetSyncPoint(BOOL bIsSyncPoint); + HRESULT STDMETHODCALLTYPE IsPreroll(); + HRESULT STDMETHODCALLTYPE SetPreroll(BOOL bIsPreroll); + long STDMETHODCALLTYPE GetActualDataLength(); + HRESULT STDMETHODCALLTYPE SetActualDataLength(long Length); + HRESULT STDMETHODCALLTYPE GetMediaType(AM_MEDIA_TYPE **ppMediaType); + HRESULT STDMETHODCALLTYPE SetMediaType(AM_MEDIA_TYPE *pMediaType); + HRESULT STDMETHODCALLTYPE IsDiscontinuity(); + HRESULT STDMETHODCALLTYPE SetDiscontinuity(BOOL bDiscontinuity); + HRESULT STDMETHODCALLTYPE GetMediaTime(LONGLONG *pTimeStart, LONGLONG *pTimeEnd); + HRESULT STDMETHODCALLTYPE SetMediaTime(LONGLONG *pTimeStart, LONGLONG *pTimeEnd); + + CMediaSample(IMemAllocator * Allocator, BYTE * Buffer, LONG BufferSize); + virtual ~CMediaSample(){} + +protected: + ULONG m_Flags; + ULONG m_TypeFlags; + BYTE * m_Buffer; + LONG m_ActualLength; + LONG m_BufferSize; + IMemAllocator * m_Allocator; + CMediaSample * m_Next; + REFERENCE_TIME m_StartTime; + REFERENCE_TIME m_StopTime; + LONGLONG m_MediaStart; + LONGLONG m_MediaStop; + AM_MEDIA_TYPE * m_MediaType; + ULONG m_StreamId; + +public: + LONG m_Ref; + + BOOL m_bMediaTimeValid; + + +}; + +CMediaSample::CMediaSample( + IMemAllocator * Allocator, + BYTE * Buffer, + LONG BufferSize) : + m_Flags(0), + m_TypeFlags(0), + m_Buffer(Buffer), + m_ActualLength(BufferSize), + m_BufferSize(BufferSize), + m_Allocator(Allocator), + m_Next(0), + m_StartTime(0), + m_StopTime(0), + m_MediaStart(0), + m_MediaStop(0), + m_MediaType(0), + m_StreamId(0), + m_Ref(0), + m_bMediaTimeValid(0) +{ +} + + +HRESULT +STDMETHODCALLTYPE +CMediaSample::QueryInterface( + IN REFIID refiid, + OUT PVOID* Output) +{ + if (IsEqualGUID(refiid, IID_IUnknown) || + IsEqualGUID(refiid, IID_IMediaSample)) + { + *Output = PVOID(this); + reinterpret_cast<IMediaSample*>(*Output)->AddRef(); + return NOERROR; + } + if (IsEqualGUID(refiid, IID_IMediaSample2)) + { +#if 0 + *Output = (IMediaSample2*)(this); + reinterpret_cast<IMediaSample2*>(*Output)->AddRef(); + return NOERROR; +#endif + } + + return E_NOINTERFACE; +} + +//------------------------------------------------------------------- +// IMediaSample interface +// +HRESULT +STDMETHODCALLTYPE +CMediaSample::GetPointer( + BYTE **ppBuffer) +{ + if (!ppBuffer) + return E_POINTER; + + *ppBuffer = m_Buffer; + return S_OK; +} + +long +STDMETHODCALLTYPE +CMediaSample::GetSize() +{ + return m_BufferSize; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::GetTime( + REFERENCE_TIME *pTimeStart, + REFERENCE_TIME *pTimeEnd) +{ + HRESULT hr; + + if (!pTimeStart || !pTimeEnd) + return E_POINTER; + + if (!(m_Flags & (AM_SAMPLE_TIMEVALID | AM_SAMPLE_STOPVALID))) + { + // no time is set + return VFW_E_SAMPLE_TIME_NOT_SET; + } + + *pTimeStart = m_StartTime; + + if (m_Flags & AM_SAMPLE_STOPVALID) + { + *pTimeEnd = m_StopTime; + hr = NOERROR; + } + else + { + *pTimeEnd = m_StartTime + 1; + hr = VFW_S_NO_STOP_TIME; + } + return hr; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::SetTime(REFERENCE_TIME *pTimeStart, REFERENCE_TIME *pTimeEnd) +{ + if (!pTimeStart) + { + m_Flags &= ~(AM_SAMPLE_TIMEVALID | AM_SAMPLE_STOPVALID); + return NOERROR; + } + + if (!pTimeEnd) + { + m_Flags &= ~(AM_SAMPLE_STOPVALID); + m_Flags |= AM_SAMPLE_TIMEVALID; + m_StartTime = *pTimeStart; + return NOERROR; + } + + + m_Flags |= (AM_SAMPLE_TIMEVALID | AM_SAMPLE_STOPVALID); + m_StartTime = *pTimeStart; + m_StopTime = *pTimeEnd; + + return NOERROR; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::IsSyncPoint() +{ + return (m_Flags & AM_SAMPLE_SPLICEPOINT) ? S_OK : S_FALSE; +} +HRESULT +STDMETHODCALLTYPE +CMediaSample::SetSyncPoint(BOOL bIsSyncPoint) +{ + if (bIsSyncPoint) + m_Flags |= AM_SAMPLE_SPLICEPOINT; + else + m_Flags &= ~AM_SAMPLE_SPLICEPOINT; + + return NOERROR; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::IsPreroll() +{ + return (m_Flags & AM_SAMPLE_PREROLL) ? S_OK : S_FALSE; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::SetPreroll(BOOL bIsPreroll) +{ + if (bIsPreroll) + m_Flags |= AM_SAMPLE_PREROLL; + else + m_Flags &= ~AM_SAMPLE_PREROLL; + + return NOERROR; +} + +long +STDMETHODCALLTYPE +CMediaSample::GetActualDataLength() +{ + return m_ActualLength; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::SetActualDataLength(long Length) +{ + if (Length > m_BufferSize) + return VFW_E_BUFFER_OVERFLOW; + + m_ActualLength = Length; + return NOERROR; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::GetMediaType(AM_MEDIA_TYPE **ppMediaType) +{ + if (!m_MediaType) + { + *ppMediaType = NULL; + return S_FALSE; + } + + assert(0); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::SetMediaType(AM_MEDIA_TYPE *pMediaType) +{ + OutputDebugStringW(L"CMediaSample::SetMediaType NotImplemented\n"); + DebugBreak(); + return E_NOTIMPL; +} + + +HRESULT +STDMETHODCALLTYPE +CMediaSample::IsDiscontinuity() +{ + return (m_Flags & AM_SAMPLE_DATADISCONTINUITY) ? S_OK : S_FALSE; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::SetDiscontinuity(BOOL bDiscontinuity) +{ + if (bDiscontinuity) + m_Flags |= AM_SAMPLE_DATADISCONTINUITY; + else + m_Flags &= ~AM_SAMPLE_DATADISCONTINUITY; + + return NOERROR; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::GetMediaTime(LONGLONG *pTimeStart, LONGLONG *pTimeEnd) +{ + if (!pTimeStart || !pTimeEnd) + return E_POINTER; + + if (!m_bMediaTimeValid) + return VFW_E_MEDIA_TIME_NOT_SET; + + m_MediaStart = *pTimeStart; + m_MediaStop = *pTimeEnd; + + return NOERROR; +} + +HRESULT +STDMETHODCALLTYPE +CMediaSample::SetMediaTime(LONGLONG *pTimeStart, LONGLONG *pTimeEnd) +{ + if (!pTimeStart || !pTimeEnd) + { + m_bMediaTimeValid = false; + return NOERROR; + } + + m_MediaStart = *pTimeStart; + m_MediaStop = *pTimeEnd; + + return NOERROR; +} + + + + +HRESULT +WINAPI +CMediaSample_Constructor( + IMemAllocator* Allocator, + BYTE* pBuffer, + ULONG BufferSize, + REFIID riid, + LPVOID * ppv) +{ +#ifdef KSPROXY_TRACE + OutputDebugStringW(L"CMediaSample_Constructor\n"); +#endif + + CMediaSample * handler = new CMediaSample(Allocator, pBuffer, BufferSize); + + if (!handler) + return E_OUTOFMEMORY; + + if (FAILED(handler->QueryInterface(riid, ppv))) + { + /* not supported */ + delete handler; + return E_NOINTERFACE; + } + + return NOERROR; +} Propchange: branches/reactos-yarotows/dll/directx/ksproxy/mediasample.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/reactos-yarotows/dll/nls/idndl/idndl.spec URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/dll/nls/idndl/…
============================================================================== --- branches/reactos-yarotows/dll/nls/idndl/idndl.spec (added) +++ branches/reactos-yarotows/dll/nls/idndl/idndl.spec [iso-8859-1] Sun Mar 28 00:52:07 2010 @@ -1,0 +1,4 @@ + + 1 stdcall DownlevelGetLocaleScripts(ptr ptr long) DownlevelGetLocaleScripts + 2 stdcall DownlevelGetStringScripts(long ptr long ptr long) kernel32.GetStringScripts + 3 stdcall DownlevelVerifyScripts(long ptr long ptr long) kernel32.VerifyScripts Propchange: branches/reactos-yarotows/dll/nls/idndl/idndl.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/reactos-yarotows/dll/win32/dbghelp/image_private.h URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/dll/win32/dbgh…
============================================================================== --- branches/reactos-yarotows/dll/win32/dbghelp/image_private.h (added) +++ branches/reactos-yarotows/dll/win32/dbghelp/image_private.h [iso-8859-1] Sun Mar 28 00:52:07 2010 @@ -1,0 +1,182 @@ +/* + * File elf_private.h - definitions for processing of ELF files + * + * Copyright (C) 1996, Eric Youngdale. + * 1999-2007 Eric Pouech + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef HAVE_ELF_H +# include <elf.h> +#endif +#ifdef HAVE_SYS_ELF32_H +# include <sys/elf32.h> +#endif +#ifdef HAVE_SYS_EXEC_ELF_H +# include <sys/exec_elf.h> +#endif +#if !defined(DT_NUM) +# if defined(DT_COUNT) +# define DT_NUM DT_COUNT +# else +/* this seems to be a satisfactory value on Solaris, which doesn't support this AFAICT */ +# define DT_NUM 24 +# endif +#endif +#ifdef HAVE_LINK_H +# include <link.h> +#endif +#ifdef HAVE_SYS_LINK_H +# include <sys/link.h> +#endif + +#define IMAGE_NO_MAP ((void*)-1) + +#ifdef __ELF__ + +#ifdef _WIN64 +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Shdr Elf64_Shdr +#define Elf_Phdr Elf64_Phdr +#define Elf_Dyn Elf64_Dyn +#define Elf_Sym Elf64_Sym +#else +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Shdr Elf32_Shdr +#define Elf_Phdr Elf32_Phdr +#define Elf_Dyn Elf32_Dyn +#define Elf_Sym Elf32_Sym +#endif +#else +#ifndef SHT_NULL +#define SHT_NULL 0 +#endif +#endif + +/* structure holding information while handling an ELF image + * allows one by one section mapping for memory savings + */ +struct image_file_map +{ + enum module_type modtype; + union + { + struct elf_file_map + { + size_t elf_size; + size_t elf_start; + int fd; + const char* shstrtab; + struct image_file_map* alternate; /* another ELF file (linked to this one) */ +#ifdef __ELF__ + Elf_Ehdr elfhdr; + struct + { + Elf_Shdr shdr; + const char* mapped; + }* sect; +#endif + } elf; + struct pe_file_map + { + HANDLE hMap; + IMAGE_NT_HEADERS ntheader; + unsigned full_count; + void* full_map; + struct + { + IMAGE_SECTION_HEADER shdr; + const char* mapped; + }* sect; + const char* strtable; + } pe; + } u; +}; + +struct image_section_map +{ + struct image_file_map* fmap; + long sidx; +}; + +extern BOOL elf_find_section(struct image_file_map* fmap, const char* name, + unsigned sht, struct image_section_map* ism); +extern const char* elf_map_section(struct image_section_map* ism); +extern void elf_unmap_section(struct image_section_map* ism); +extern DWORD_PTR elf_get_map_rva(const struct image_section_map* ism); +extern unsigned elf_get_map_size(const struct image_section_map* ism); + +extern BOOL pe_find_section(struct image_file_map* fmap, const char* name, + struct image_section_map* ism); +extern const char* pe_map_section(struct image_section_map* psm); +extern void pe_unmap_section(struct image_section_map* psm); +extern DWORD_PTR pe_get_map_rva(const struct image_section_map* psm); +extern unsigned pe_get_map_size(const struct image_section_map* psm); + +static inline BOOL image_find_section(struct image_file_map* fmap, const char* name, + struct image_section_map* ism) +{ + switch (fmap->modtype) + { + case DMT_ELF: return elf_find_section(fmap, name, SHT_NULL, ism); + case DMT_PE: return pe_find_section(fmap, name, ism); + default: assert(0); return FALSE; + } +} + +static inline const char* image_map_section(struct image_section_map* ism) +{ + if (!ism->fmap) return NULL; + switch (ism->fmap->modtype) + { + case DMT_ELF: return elf_map_section(ism); + case DMT_PE: return pe_map_section(ism); + default: assert(0); return NULL; + } +} + +static inline void image_unmap_section(struct image_section_map* ism) +{ + if (!ism->fmap) return; + switch (ism->fmap->modtype) + { + case DMT_ELF: elf_unmap_section(ism); break; + case DMT_PE: pe_unmap_section(ism); break; + default: assert(0); return; + } +} + +static inline DWORD_PTR image_get_map_rva(struct image_section_map* ism) +{ + if (!ism->fmap) return 0; + switch (ism->fmap->modtype) + { + case DMT_ELF: return elf_get_map_rva(ism); + case DMT_PE: return pe_get_map_rva(ism); + default: assert(0); return 0; + } +} + +static inline unsigned image_get_map_size(struct image_section_map* ism) +{ + if (!ism->fmap) return 0; + switch (ism->fmap->modtype) + { + case DMT_ELF: return elf_get_map_size(ism); + case DMT_PE: return pe_get_map_size(ism); + default: assert(0); return 0; + } +} Propchange: branches/reactos-yarotows/dll/win32/dbghelp/image_private.h ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/reactos-yarotows/dll/win32/rsaenh/sha2.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/dll/win32/rsae…
============================================================================== --- branches/reactos-yarotows/dll/win32/rsaenh/sha2.c (added) +++ branches/reactos-yarotows/dll/win32/rsaenh/sha2.c [iso-8859-1] Sun Mar 28 00:52:07 2010 @@ -1,0 +1,1003 @@ +/* + * FILE: sha2.c + * AUTHOR: Aaron D. Gifford -
http://www.aarongifford.com/
+ * + * Copyright (c) 2000-2001, Aaron D. Gifford + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "config.h" + +#include <string.h> +#include <assert.h> +#include "sha2.h" + +/* + * ASSERT NOTE: + * Some sanity checking code is included using assert(). On my FreeBSD + * system, this additional code can be removed by compiling with NDEBUG + * defined. Check your own systems manpage on assert() to see how to + * compile WITHOUT the sanity checking code on your system. + * + * UNROLLED TRANSFORM LOOP NOTE: + * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform + * loop version for the hash transform rounds (defined using macros + * later in this file). Either define on the command line, for example: + * + * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c + * + * or define below: + * + * #define SHA2_UNROLL_TRANSFORM + * + */ + +/*** SHA-256/384/512 Various Length Definitions ***********************/ +/* NOTE: Most of these are in sha2.h */ +#define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) +#define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) +#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) + +#define SHA2_WORD64_CONST(dw1, dw2) (((sha2_word64)(dw1) << 32) | (dw2)) + +/*** ENDIAN REVERSAL MACROS *******************************************/ +#ifndef WORDS_BIGENDIAN +#define REVERSE32(w,x) { \ + sha2_word32 tmp = (w); \ + tmp = (tmp >> 16) | (tmp << 16); \ + (x) = ((tmp & 0xff00ff00) >> 8) | ((tmp & 0x00ff00ff) << 8); \ +} +#define REVERSE64(w,x) { \ + sha2_word64 tmp = (w); \ + tmp = (tmp >> 32) | (tmp << 32); \ + tmp = ((tmp & SHA2_WORD64_CONST(0xff00ff00, 0xff00ff00)) >> 8) | \ + ((tmp & SHA2_WORD64_CONST(0x00ff00ff, 0x00ff00ff)) << 8); \ + (x) = ((tmp & SHA2_WORD64_CONST(0xffff0000, 0xffff0000)) >> 16) | \ + ((tmp & SHA2_WORD64_CONST(0x0000ffff, 0x0000ffff)) << 16); \ +} +#endif + +/* + * Macro for incrementally adding the unsigned 64-bit integer n to the + * unsigned 128-bit integer (represented using a two-element array of + * 64-bit words): + */ +#define ADDINC128(w,n) { \ + (w)[0] += (sha2_word64)(n); \ + if ((w)[0] < (n)) { \ + (w)[1]++; \ + } \ +} + +/* + * Macros for copying blocks of memory and for zeroing out ranges + * of memory. Using these macros makes it easy to switch from + * using memset()/memcpy() and using bzero()/bcopy(). + * + * Please define either SHA2_USE_MEMSET_MEMCPY or define + * SHA2_USE_BZERO_BCOPY depending on which function set you + * choose to use: + */ +#if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY) +/* Default to memset()/memcpy() if no option is specified */ +#define SHA2_USE_MEMSET_MEMCPY 1 +#endif +#if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY) +/* Abort with an error if BOTH options are defined */ +#error Define either SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY, not both! +#endif + +#ifdef SHA2_USE_MEMSET_MEMCPY +#define MEMSET_BZERO(p,l) memset((p), 0, (l)) +#define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) +#endif +#ifdef SHA2_USE_BZERO_BCOPY +#define MEMSET_BZERO(p,l) bzero((p), (l)) +#define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) +#endif + + +/*** THE SIX LOGICAL FUNCTIONS ****************************************/ +/* + * Bit shifting and rotation (used by the six SHA-XYZ logical functions: + * + * NOTE: The naming of R and S appears backwards here (R is a SHIFT and + * S is a ROTATION) because the SHA-256/384/512 description document + * (see
http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf
) uses this + * same "backwards" definition. + */ +/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ +#define R(b,x) ((x) >> (b)) +/* 32-bit Rotate-right (used in SHA-256): */ +#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) +/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ +#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) + +/* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ +#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) +#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) + +/* Four of six logical functions used in SHA-256: */ +#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) +#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) +#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) +#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) + +/* Four of six logical functions used in SHA-384 and SHA-512: */ +#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) +#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) +#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) +#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) + +/*** INTERNAL FUNCTION PROTOTYPES *************************************/ +/* NOTE: These should not be accessed directly from outside this + * library -- they are intended for private internal visibility/use + * only. + */ +void SHA512_Last(SHA512_CTX*); +void SHA256_Transform(SHA256_CTX*, const sha2_word32*); +void SHA512_Transform(SHA512_CTX*, const sha2_word64*); + + +/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ +/* Hash constant words K for SHA-256: */ +static const sha2_word32 K256[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + +/* Initial hash value H for SHA-256: */ +static const sha2_word32 sha256_initial_hash_value[8] = { + 0x6a09e667, + 0xbb67ae85, + 0x3c6ef372, + 0xa54ff53a, + 0x510e527f, + 0x9b05688c, + 0x1f83d9ab, + 0x5be0cd19 +}; + +/* Hash constant words K for SHA-384 and SHA-512: */ +static const sha2_word64 K512[80] = { + SHA2_WORD64_CONST(0x428a2f98, 0xd728ae22), SHA2_WORD64_CONST(0x71374491, 0x23ef65cd), + SHA2_WORD64_CONST(0xb5c0fbcf, 0xec4d3b2f), SHA2_WORD64_CONST(0xe9b5dba5, 0x8189dbbc), + SHA2_WORD64_CONST(0x3956c25b, 0xf348b538), SHA2_WORD64_CONST(0x59f111f1, 0xb605d019), + SHA2_WORD64_CONST(0x923f82a4, 0xaf194f9b), SHA2_WORD64_CONST(0xab1c5ed5, 0xda6d8118), + SHA2_WORD64_CONST(0xd807aa98, 0xa3030242), SHA2_WORD64_CONST(0x12835b01, 0x45706fbe), + SHA2_WORD64_CONST(0x243185be, 0x4ee4b28c), SHA2_WORD64_CONST(0x550c7dc3, 0xd5ffb4e2), + SHA2_WORD64_CONST(0x72be5d74, 0xf27b896f), SHA2_WORD64_CONST(0x80deb1fe, 0x3b1696b1), + SHA2_WORD64_CONST(0x9bdc06a7, 0x25c71235), SHA2_WORD64_CONST(0xc19bf174, 0xcf692694), + SHA2_WORD64_CONST(0xe49b69c1, 0x9ef14ad2), SHA2_WORD64_CONST(0xefbe4786, 0x384f25e3), + SHA2_WORD64_CONST(0x0fc19dc6, 0x8b8cd5b5), SHA2_WORD64_CONST(0x240ca1cc, 0x77ac9c65), + SHA2_WORD64_CONST(0x2de92c6f, 0x592b0275), SHA2_WORD64_CONST(0x4a7484aa, 0x6ea6e483), + SHA2_WORD64_CONST(0x5cb0a9dc, 0xbd41fbd4), SHA2_WORD64_CONST(0x76f988da, 0x831153b5), + SHA2_WORD64_CONST(0x983e5152, 0xee66dfab), SHA2_WORD64_CONST(0xa831c66d, 0x2db43210), + SHA2_WORD64_CONST(0xb00327c8, 0x98fb213f), SHA2_WORD64_CONST(0xbf597fc7, 0xbeef0ee4), + SHA2_WORD64_CONST(0xc6e00bf3, 0x3da88fc2), SHA2_WORD64_CONST(0xd5a79147, 0x930aa725), + SHA2_WORD64_CONST(0x06ca6351, 0xe003826f), SHA2_WORD64_CONST(0x14292967, 0x0a0e6e70), + SHA2_WORD64_CONST(0x27b70a85, 0x46d22ffc), SHA2_WORD64_CONST(0x2e1b2138, 0x5c26c926), + SHA2_WORD64_CONST(0x4d2c6dfc, 0x5ac42aed), SHA2_WORD64_CONST(0x53380d13, 0x9d95b3df), + SHA2_WORD64_CONST(0x650a7354, 0x8baf63de), SHA2_WORD64_CONST(0x766a0abb, 0x3c77b2a8), + SHA2_WORD64_CONST(0x81c2c92e, 0x47edaee6), SHA2_WORD64_CONST(0x92722c85, 0x1482353b), + SHA2_WORD64_CONST(0xa2bfe8a1, 0x4cf10364), SHA2_WORD64_CONST(0xa81a664b, 0xbc423001), + SHA2_WORD64_CONST(0xc24b8b70, 0xd0f89791), SHA2_WORD64_CONST(0xc76c51a3, 0x0654be30), + SHA2_WORD64_CONST(0xd192e819, 0xd6ef5218), SHA2_WORD64_CONST(0xd6990624, 0x5565a910), + SHA2_WORD64_CONST(0xf40e3585, 0x5771202a), SHA2_WORD64_CONST(0x106aa070, 0x32bbd1b8), + SHA2_WORD64_CONST(0x19a4c116, 0xb8d2d0c8), SHA2_WORD64_CONST(0x1e376c08, 0x5141ab53), + SHA2_WORD64_CONST(0x2748774c, 0xdf8eeb99), SHA2_WORD64_CONST(0x34b0bcb5, 0xe19b48a8), + SHA2_WORD64_CONST(0x391c0cb3, 0xc5c95a63), SHA2_WORD64_CONST(0x4ed8aa4a, 0xe3418acb), + SHA2_WORD64_CONST(0x5b9cca4f, 0x7763e373), SHA2_WORD64_CONST(0x682e6ff3, 0xd6b2b8a3), + SHA2_WORD64_CONST(0x748f82ee, 0x5defb2fc), SHA2_WORD64_CONST(0x78a5636f, 0x43172f60), + SHA2_WORD64_CONST(0x84c87814, 0xa1f0ab72), SHA2_WORD64_CONST(0x8cc70208, 0x1a6439ec), + SHA2_WORD64_CONST(0x90befffa, 0x23631e28), SHA2_WORD64_CONST(0xa4506ceb, 0xde82bde9), + SHA2_WORD64_CONST(0xbef9a3f7, 0xb2c67915), SHA2_WORD64_CONST(0xc67178f2, 0xe372532b), + SHA2_WORD64_CONST(0xca273ece, 0xea26619c), SHA2_WORD64_CONST(0xd186b8c7, 0x21c0c207), + SHA2_WORD64_CONST(0xeada7dd6, 0xcde0eb1e), SHA2_WORD64_CONST(0xf57d4f7f, 0xee6ed178), + SHA2_WORD64_CONST(0x06f067aa, 0x72176fba), SHA2_WORD64_CONST(0x0a637dc5, 0xa2c898a6), + SHA2_WORD64_CONST(0x113f9804, 0xbef90dae), SHA2_WORD64_CONST(0x1b710b35, 0x131c471b), + SHA2_WORD64_CONST(0x28db77f5, 0x23047d84), SHA2_WORD64_CONST(0x32caab7b, 0x40c72493), + SHA2_WORD64_CONST(0x3c9ebe0a, 0x15c9bebc), SHA2_WORD64_CONST(0x431d67c4, 0x9c100d4c), + SHA2_WORD64_CONST(0x4cc5d4be, 0xcb3e42b6), SHA2_WORD64_CONST(0x597f299c, 0xfc657e2a), + SHA2_WORD64_CONST(0x5fcb6fab, 0x3ad6faec), SHA2_WORD64_CONST(0x6c44198c, 0x4a475817) +}; + +/* Initial hash value H for SHA-384 */ +static const sha2_word64 sha384_initial_hash_value[8] = { + SHA2_WORD64_CONST(0xcbbb9d5d, 0xc1059ed8), + SHA2_WORD64_CONST(0x629a292a, 0x367cd507), + SHA2_WORD64_CONST(0x9159015a, 0x3070dd17), + SHA2_WORD64_CONST(0x152fecd8, 0xf70e5939), + SHA2_WORD64_CONST(0x67332667, 0xffc00b31), + SHA2_WORD64_CONST(0x8eb44a87, 0x68581511), + SHA2_WORD64_CONST(0xdb0c2e0d, 0x64f98fa7), + SHA2_WORD64_CONST(0x47b5481d, 0xbefa4fa4) +}; + +/* Initial hash value H for SHA-512 */ +static const sha2_word64 sha512_initial_hash_value[8] = { + SHA2_WORD64_CONST(0x6a09e667, 0xf3bcc908), + SHA2_WORD64_CONST(0xbb67ae85, 0x84caa73b), + SHA2_WORD64_CONST(0x3c6ef372, 0xfe94f82b), + SHA2_WORD64_CONST(0xa54ff53a, 0x5f1d36f1), + SHA2_WORD64_CONST(0x510e527f, 0xade682d1), + SHA2_WORD64_CONST(0x9b05688c, 0x2b3e6c1f), + SHA2_WORD64_CONST(0x1f83d9ab, 0xfb41bd6b), + SHA2_WORD64_CONST(0x5be0cd19, 0x137e2179) +}; + +/* + * Constant used by SHA256/384/512_End() functions for converting the + * digest to a readable hexadecimal character string: + */ +static const char sha2_hex_digits[] = "0123456789abcdef"; + + +/*** SHA-256: *********************************************************/ +void SHA256_Init(SHA256_CTX* context) { + if (context == (SHA256_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA256_BLOCK_LENGTH); + context->bitcount = 0; +} + +#ifdef SHA2_UNROLL_TRANSFORM + +/* Unrolled SHA-256 round macros: */ + +#ifndef WORDS_BIGENDIAN + +#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ + REVERSE32(*data++, W256[j]); \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ + K256[j] + W256[j]; \ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ + + +#else + +#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ + K256[j] + (W256[j] = *data++); \ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ + +#endif + +#define ROUND256(a,b,c,d,e,f,g,h) \ + s0 = W256[(j+1)&0x0f]; \ + s0 = sigma0_256(s0); \ + s1 = W256[(j+14)&0x0f]; \ + s1 = sigma1_256(s1); \ + T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ + (d) += T1; \ + (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ + j++ + +void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { + sha2_word32 a, b, c, d, e, f, g, h, s0, s1; + sha2_word32 T1, *W256; + int j; + + W256 = (sha2_word32*)context->buffer; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { + /* Rounds 0 to 15 (unrolled): */ + ROUND256_0_TO_15(a,b,c,d,e,f,g,h); + ROUND256_0_TO_15(h,a,b,c,d,e,f,g); + ROUND256_0_TO_15(g,h,a,b,c,d,e,f); + ROUND256_0_TO_15(f,g,h,a,b,c,d,e); + ROUND256_0_TO_15(e,f,g,h,a,b,c,d); + ROUND256_0_TO_15(d,e,f,g,h,a,b,c); + ROUND256_0_TO_15(c,d,e,f,g,h,a,b); + ROUND256_0_TO_15(b,c,d,e,f,g,h,a); + } while (j < 16); + + /* Now for the remaining rounds to 64: */ + do { + ROUND256(a,b,c,d,e,f,g,h); + ROUND256(h,a,b,c,d,e,f,g); + ROUND256(g,h,a,b,c,d,e,f); + ROUND256(f,g,h,a,b,c,d,e); + ROUND256(e,f,g,h,a,b,c,d); + ROUND256(d,e,f,g,h,a,b,c); + ROUND256(c,d,e,f,g,h,a,b); + ROUND256(b,c,d,e,f,g,h,a); + } while (j < 64); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = 0; +} + +#else /* SHA2_UNROLL_TRANSFORM */ + +void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { + sha2_word32 a, b, c, d, e, f, g, h, s0, s1; + sha2_word32 T1, T2, *W256; + int j; + + W256 = (sha2_word32*)context->buffer; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { +#ifndef WORDS_BIGENDIAN + /* Copy data while converting to host byte order */ + REVERSE32(*data++,W256[j]); + /* Apply the SHA-256 compression function to update a..h */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; +#else + /* Apply the SHA-256 compression function to update a..h with copy */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); +#endif + T2 = Sigma0_256(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 16); + + do { + /* Part of the message block expansion: */ + s0 = W256[(j+1)&0x0f]; + s0 = sigma0_256(s0); + s1 = W256[(j+14)&0x0f]; + s1 = sigma1_256(s1); + + /* Apply the SHA-256 compression function to update a..h */ + T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); + T2 = Sigma0_256(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 64); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = T2 = 0; +} + +#endif /* SHA2_UNROLL_TRANSFORM */ + +void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { + unsigned int freespace, usedspace; + + if (len == 0) { + /* Calling with no data is valid - we do nothing */ + return; + } + + /* Sanity check: */ + assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); + + usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; + if (usedspace > 0) { + /* Calculate how much free space is available in the buffer */ + freespace = SHA256_BLOCK_LENGTH - usedspace; + + if (len >= freespace) { + /* Fill the buffer completely and process it */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); + context->bitcount += freespace << 3; + len -= freespace; + data += freespace; + SHA256_Transform(context, (sha2_word32*)context->buffer); + } else { + /* The buffer is not yet full */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, len); + context->bitcount += len << 3; + /* Clean up: */ + usedspace = freespace = 0; + return; + } + } + while (len >= SHA256_BLOCK_LENGTH) { + /* Process as many complete blocks as we can */ + SHA256_Transform(context, (sha2_word32*)data); + context->bitcount += SHA256_BLOCK_LENGTH << 3; + len -= SHA256_BLOCK_LENGTH; + data += SHA256_BLOCK_LENGTH; + } + if (len > 0) { + /* There's left-overs, so save 'em */ + MEMCPY_BCOPY(context->buffer, data, len); + context->bitcount += len << 3; + } + /* Clean up: */ + usedspace = freespace = 0; +} + +void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { + sha2_word32 *d = (sha2_word32*)digest; + unsigned int usedspace; + + /* Sanity check: */ + assert(context != (SHA256_CTX*)0); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; +#ifndef WORDS_BIGENDIAN + /* Convert FROM host byte order */ + REVERSE64(context->bitcount,context->bitcount); +#endif + if (usedspace > 0) { + /* Begin padding with a 1 bit: */ + context->buffer[usedspace++] = 0x80; + + if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { + /* Set-up for the last transform: */ + MEMSET_BZERO(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace); + } else { + if (usedspace < SHA256_BLOCK_LENGTH) { + MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); + } + /* Do second-to-last transform: */ + SHA256_Transform(context, (sha2_word32*)context->buffer); + + /* And set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); + } + } else { + /* Set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); + + /* Begin padding with a 1 bit: */ + *context->buffer = 0x80; + } + /* Set the bit count: */ + *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; + + /* Final transform: */ + SHA256_Transform(context, (sha2_word32*)context->buffer); + +#ifndef WORDS_BIGENDIAN + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 8; j++) { + REVERSE32(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } +#else + MEMCPY_BCOPY(d, context->state, SHA256_DIGEST_LENGTH); +#endif + } + + /* Clean up state data: */ + MEMSET_BZERO(context, sizeof(context)); + usedspace = 0; +} + +char *SHA256_End(SHA256_CTX* context, char buffer[]) { + sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA256_CTX*)0); + + if (buffer != (char*)0) { + SHA256_Final(digest, context); + + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); + return buffer; +} + +char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { + SHA256_CTX context; + + SHA256_Init(&context); + SHA256_Update(&context, data, len); + return SHA256_End(&context, digest); +} + + +/*** SHA-512: *********************************************************/ +void SHA512_Init(SHA512_CTX* context) { + if (context == (SHA512_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH); + context->bitcount[0] = context->bitcount[1] = 0; +} + +#ifdef SHA2_UNROLL_TRANSFORM + +/* Unrolled SHA-512 round macros: */ +#ifndef WORDS_BIGENDIAN + +#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ + REVERSE64(*data++, W512[j]); \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ + K512[j] + W512[j]; \ + (d) += T1, \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ + j++ + + +#else + +#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ + K512[j] + (W512[j] = *data++); \ + (d) += T1; \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ + j++ + +#endif + +#define ROUND512(a,b,c,d,e,f,g,h) \ + s0 = W512[(j+1)&0x0f]; \ + s0 = sigma0_512(s0); \ + s1 = W512[(j+14)&0x0f]; \ + s1 = sigma1_512(s1); \ + T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ + (d) += T1; \ + (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ + j++ + +void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { + sha2_word64 a, b, c, d, e, f, g, h, s0, s1; + sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { + ROUND512_0_TO_15(a,b,c,d,e,f,g,h); + ROUND512_0_TO_15(h,a,b,c,d,e,f,g); + ROUND512_0_TO_15(g,h,a,b,c,d,e,f); + ROUND512_0_TO_15(f,g,h,a,b,c,d,e); + ROUND512_0_TO_15(e,f,g,h,a,b,c,d); + ROUND512_0_TO_15(d,e,f,g,h,a,b,c); + ROUND512_0_TO_15(c,d,e,f,g,h,a,b); + ROUND512_0_TO_15(b,c,d,e,f,g,h,a); + } while (j < 16); + + /* Now for the remaining rounds up to 79: */ + do { + ROUND512(a,b,c,d,e,f,g,h); + ROUND512(h,a,b,c,d,e,f,g); + ROUND512(g,h,a,b,c,d,e,f); + ROUND512(f,g,h,a,b,c,d,e); + ROUND512(e,f,g,h,a,b,c,d); + ROUND512(d,e,f,g,h,a,b,c); + ROUND512(c,d,e,f,g,h,a,b); + ROUND512(b,c,d,e,f,g,h,a); + } while (j < 80); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = 0; +} + +#else /* SHA2_UNROLL_TRANSFORM */ + +void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { + sha2_word64 a, b, c, d, e, f, g, h, s0, s1; + sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; + int j; + + /* Initialize registers with the prev. intermediate value */ + a = context->state[0]; + b = context->state[1]; + c = context->state[2]; + d = context->state[3]; + e = context->state[4]; + f = context->state[5]; + g = context->state[6]; + h = context->state[7]; + + j = 0; + do { +#ifndef WORDS_BIGENDIAN + /* Convert TO host byte order */ + REVERSE64(*data++, W512[j]); + /* Apply the SHA-512 compression function to update a..h */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; +#else + /* Apply the SHA-512 compression function to update a..h with copy */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); +#endif + T2 = Sigma0_512(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 16); + + do { + /* Part of the message block expansion: */ + s0 = W512[(j+1)&0x0f]; + s0 = sigma0_512(s0); + s1 = W512[(j+14)&0x0f]; + s1 = sigma1_512(s1); + + /* Apply the SHA-512 compression function to update a..h */ + T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); + T2 = Sigma0_512(a) + Maj(a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + + j++; + } while (j < 80); + + /* Compute the current intermediate hash value */ + context->state[0] += a; + context->state[1] += b; + context->state[2] += c; + context->state[3] += d; + context->state[4] += e; + context->state[5] += f; + context->state[6] += g; + context->state[7] += h; + + /* Clean up */ + a = b = c = d = e = f = g = h = T1 = T2 = 0; +} + +#endif /* SHA2_UNROLL_TRANSFORM */ + +void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { + unsigned int freespace, usedspace; + + if (len == 0) { + /* Calling with no data is valid - we do nothing */ + return; + } + + /* Sanity check: */ + assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); + + usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; + if (usedspace > 0) { + /* Calculate how much free space is available in the buffer */ + freespace = SHA512_BLOCK_LENGTH - usedspace; + + if (len >= freespace) { + /* Fill the buffer completely and process it */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); + ADDINC128(context->bitcount, freespace << 3); + len -= freespace; + data += freespace; + SHA512_Transform(context, (sha2_word64*)context->buffer); + } else { + /* The buffer is not yet full */ + MEMCPY_BCOPY(&context->buffer[usedspace], data, len); + ADDINC128(context->bitcount, len << 3); + /* Clean up: */ + usedspace = freespace = 0; + return; + } + } + while (len >= SHA512_BLOCK_LENGTH) { + /* Process as many complete blocks as we can */ + SHA512_Transform(context, (sha2_word64*)data); + ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); + len -= SHA512_BLOCK_LENGTH; + data += SHA512_BLOCK_LENGTH; + } + if (len > 0) { + /* There's left-overs, so save 'em */ + MEMCPY_BCOPY(context->buffer, data, len); + ADDINC128(context->bitcount, len << 3); + } + /* Clean up: */ + usedspace = freespace = 0; +} + +void SHA512_Last(SHA512_CTX* context) { + unsigned int usedspace; + + usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; +#ifndef WORDS_BIGENDIAN + /* Convert FROM host byte order */ + REVERSE64(context->bitcount[0],context->bitcount[0]); + REVERSE64(context->bitcount[1],context->bitcount[1]); +#endif + if (usedspace > 0) { + /* Begin padding with a 1 bit: */ + context->buffer[usedspace++] = 0x80; + + if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { + /* Set-up for the last transform: */ + MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace); + } else { + if (usedspace < SHA512_BLOCK_LENGTH) { + MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); + } + /* Do second-to-last transform: */ + SHA512_Transform(context, (sha2_word64*)context->buffer); + + /* And set-up for the last transform: */ + MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); + } + } else { + /* Prepare for final transform: */ + MEMSET_BZERO(context->buffer, SHA512_SHORT_BLOCK_LENGTH); + + /* Begin padding with a 1 bit: */ + *context->buffer = 0x80; + } + /* Store the length of input data (in bits): */ + *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; + *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; + + /* Final transform: */ + SHA512_Transform(context, (sha2_word64*)context->buffer); +} + +void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { + sha2_word64 *d = (sha2_word64*)digest; + + /* Sanity check: */ + assert(context != (SHA512_CTX*)0); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + SHA512_Last(context); + + /* Save the hash data for output: */ +#ifndef WORDS_BIGENDIAN + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 8; j++) { + REVERSE64(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } +#else + MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); +#endif + } + + /* Zero out state data */ + MEMSET_BZERO(context, sizeof(context)); +} + +char *SHA512_End(SHA512_CTX* context, char buffer[]) { + sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA512_CTX*)0); + + if (buffer != (char*)0) { + SHA512_Final(digest, context); + + for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); + return buffer; +} + +char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { + SHA512_CTX context; + + SHA512_Init(&context); + SHA512_Update(&context, data, len); + return SHA512_End(&context, digest); +} + + +/*** SHA-384: *********************************************************/ +void SHA384_Init(SHA384_CTX* context) { + if (context == (SHA384_CTX*)0) { + return; + } + MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); + MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH); + context->bitcount[0] = context->bitcount[1] = 0; +} + +void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { + SHA512_Update((SHA512_CTX*)context, data, len); +} + +void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { + sha2_word64 *d = (sha2_word64*)digest; + + /* Sanity check: */ + assert(context != (SHA384_CTX*)0); + + /* If no digest buffer is passed, we don't bother doing this: */ + if (digest != (sha2_byte*)0) { + SHA512_Last((SHA512_CTX*)context); + + /* Save the hash data for output: */ +#ifndef WORDS_BIGENDIAN + { + /* Convert TO host byte order */ + int j; + for (j = 0; j < 6; j++) { + REVERSE64(context->state[j],context->state[j]); + *d++ = context->state[j]; + } + } +#else + MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); +#endif + } + + /* Zero out state data */ + MEMSET_BZERO(context, sizeof(context)); +} + +char *SHA384_End(SHA384_CTX* context, char buffer[]) { + sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; + int i; + + /* Sanity check: */ + assert(context != (SHA384_CTX*)0); + + if (buffer != (char*)0) { + SHA384_Final(digest, context); + + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { + *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; + *buffer++ = sha2_hex_digits[*d & 0x0f]; + d++; + } + *buffer = (char)0; + } else { + MEMSET_BZERO(context, sizeof(context)); + } + MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); + return buffer; +} + +char* SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { + SHA384_CTX context; + + SHA384_Init(&context); + SHA384_Update(&context, data, len); + return SHA384_End(&context, digest); +} Propchange: branches/reactos-yarotows/dll/win32/rsaenh/sha2.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/reactos-yarotows/dll/win32/rsaenh/sha2.h URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/dll/win32/rsae…
============================================================================== --- branches/reactos-yarotows/dll/win32/rsaenh/sha2.h (added) +++ branches/reactos-yarotows/dll/win32/rsaenh/sha2.h [iso-8859-1] Sun Mar 28 00:52:07 2010 @@ -1,0 +1,89 @@ +/* + * FILE: sha2.h + * AUTHOR: Aaron D. Gifford -
http://www.aarongifford.com/
+ * + * Copyright (c) 2000-2001, Aaron D. Gifford + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __SHA2_H__ +#define __SHA2_H__ + +#include <basetsd.h> + +/*** SHA-256/384/512 Various Length Definitions ***********************/ +#define SHA256_BLOCK_LENGTH 64 +#define SHA256_DIGEST_LENGTH 32 +#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) +#define SHA384_BLOCK_LENGTH 128 +#define SHA384_DIGEST_LENGTH 48 +#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) +#define SHA512_BLOCK_LENGTH 128 +#define SHA512_DIGEST_LENGTH 64 +#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) + + +/*** SHA-256/384/512 Context Structures *******************************/ +typedef UINT8 sha2_byte; /* Exactly 1 byte */ +typedef UINT32 sha2_word32; /* Exactly 4 bytes */ +typedef UINT64 sha2_word64; /* Exactly 8 bytes */ + +typedef struct _SHA256_CTX { + sha2_word32 state[8]; + sha2_word64 bitcount; + sha2_byte buffer[SHA256_BLOCK_LENGTH]; +} SHA256_CTX; +typedef struct _SHA512_CTX { + sha2_word64 state[8]; + sha2_word64 bitcount[2]; + sha2_byte buffer[SHA512_BLOCK_LENGTH]; +} SHA512_CTX; + +typedef SHA512_CTX SHA384_CTX; + + +/*** SHA-256/384/512 Function Prototypes ******************************/ + +void SHA256_Init(SHA256_CTX *); +void SHA256_Update(SHA256_CTX*, const sha2_byte*, size_t); +void SHA256_Final(sha2_byte[SHA256_DIGEST_LENGTH], SHA256_CTX*); +char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); +char* SHA256_Data(const sha2_byte*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); + +void SHA384_Init(SHA384_CTX*); +void SHA384_Update(SHA384_CTX*, const sha2_byte*, size_t); +void SHA384_Final(sha2_byte[SHA384_DIGEST_LENGTH], SHA384_CTX*); +char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); +char* SHA384_Data(const sha2_byte*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); + +void SHA512_Init(SHA512_CTX*); +void SHA512_Update(SHA512_CTX*, const sha2_byte*, size_t); +void SHA512_Final(sha2_byte[SHA512_DIGEST_LENGTH], SHA512_CTX*); +char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); +char* SHA512_Data(const sha2_byte*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); + +#endif /* __SHA2_H__ */ Propchange: branches/reactos-yarotows/dll/win32/rsaenh/sha2.h ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 9 months
1
0
0
0
[jgardou] 46505: svn will drive me nuts, part 1/x
by jgardou@svn.reactos.org
Author: jgardou Date: Sun Mar 28 00:28:24 2010 New Revision: 46505 URL:
http://svn.reactos.org/svn/reactos?rev=46505&view=rev
Log: svn will drive me nuts, part 1/x Added: branches/reactos-yarotows/drivers/bus/acpi/eval.c (with props) branches/reactos-yarotows/drivers/bus/acpi/interface.c (with props) branches/reactos-yarotows/drivers/storage/scsiport/scsiport.pspec (with props) branches/reactos-yarotows/drivers/storage/scsiport/stubs.c (with props) branches/reactos-yarotows/hal/halx86/up/pic.c (with props) branches/reactos-yarotows/hal/halx86/up/processor.c (with props) branches/reactos-yarotows/include/dxsdk/bdatif.idl branches/reactos-yarotows/include/ndk/peb_teb.h (with props) Modified: branches/reactos-yarotows/ (props changed) branches/reactos-yarotows/drivers/bus/acpi/cmbatt/cmbpnp.c branches/reactos-yarotows/drivers/bus/acpi/compbatt/compbatt.c branches/reactos-yarotows/drivers/bus/acpi/compbatt/compbatt.h branches/reactos-yarotows/drivers/bus/acpi/compbatt/comppnp.c branches/reactos-yarotows/media/inf/machine.inf branches/reactos-yarotows/ntoskrnl/io/pnpmgr/pnpmgr.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/reactos-yarotows/drivers/bus/acpi/cmbatt/cmbpnp.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/drivers/bus/ac…
Modified: branches/reactos-yarotows/drivers/bus/acpi/compbatt/compbatt.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/drivers/bus/ac…
Modified: branches/reactos-yarotows/drivers/bus/acpi/compbatt/compbatt.h URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/drivers/bus/ac…
Modified: branches/reactos-yarotows/drivers/bus/acpi/compbatt/comppnp.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/drivers/bus/ac…
Added: branches/reactos-yarotows/drivers/bus/acpi/eval.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/drivers/bus/ac…
Added: branches/reactos-yarotows/drivers/bus/acpi/interface.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/drivers/bus/ac…
Added: branches/reactos-yarotows/drivers/storage/scsiport/scsiport.pspec URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/drivers/storag…
Added: branches/reactos-yarotows/drivers/storage/scsiport/stubs.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/drivers/storag…
Added: branches/reactos-yarotows/hal/halx86/up/pic.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/hal/halx86/up/…
Added: branches/reactos-yarotows/hal/halx86/up/processor.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/hal/halx86/up/…
Added: branches/reactos-yarotows/include/dxsdk/bdatif.idl URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/include/dxsdk/…
Added: branches/reactos-yarotows/include/ndk/peb_teb.h URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/include/ndk/pe…
Modified: branches/reactos-yarotows/media/inf/machine.inf URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/media/inf/mach…
Modified: branches/reactos-yarotows/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/ntoskrnl/io/pn…
14 years, 9 months
1
0
0
0
[tkreuzer] 46504: Merge from amd64-branch: 46483 (tkreuzer) [CRT] - add _wctype table, it's not identical to _ctype as assumed before - point _pwctype to _wctype instead of _ctype - implement __pctype_func and __pwctype_func 46502 (tkreuzer) [MSVCRT] - enable exports for __pctype_func, __pwctype_func, _wctype
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 28 00:01:05 2010 New Revision: 46504 URL:
http://svn.reactos.org/svn/reactos?rev=46504&view=rev
Log: Merge from amd64-branch: 46483 (tkreuzer) [CRT] - add _wctype table, it's not identical to _ctype as assumed before - point _pwctype to _wctype instead of _ctype - implement __pctype_func and __pwctype_func 46502 (tkreuzer) [MSVCRT] - enable exports for __pctype_func, __pwctype_func, _wctype Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.def trunk/reactos/lib/sdk/crt/string/ctype.c Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.de…
============================================================================== --- trunk/reactos/dll/win32/msvcrt/msvcrt.def [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvcrt/msvcrt.def [iso-8859-1] Sun Mar 28 00:01:05 2010 @@ -158,9 +158,9 @@ __p__winminor @153 __p__winver @154 __p__wpgmptr @155 -; __pctype_func @156 + __pctype_func @156 __pioinfo @157 DATA -; __pwctype_func @158 + __pwctype_func @158 __pxcptinfoptrs @159 __set_app_type @160 __setlc_active @161 DATA @@ -583,7 +583,7 @@ _wcsupr @576 _wctime @577 ; _wctime64 @578 -; _wctype @579 + _wctype @579 _wenviron @580 DATA _wexecl @581 _wexecle @582 Modified: trunk/reactos/lib/sdk/crt/string/ctype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/ctype.c…
============================================================================== --- trunk/reactos/lib/sdk/crt/string/ctype.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/string/ctype.c [iso-8859-1] Sun Mar 28 00:01:05 2010 @@ -289,8 +289,267 @@ 0 /* 0xff */ }; +const unsigned short _wctype[] = { + 0, /* <EOF>, 0xFFFF */ + _CONTROL, /* CTRL+@, 0x00 */ + _CONTROL, /* CTRL+A, 0x01 */ + _CONTROL, /* CTRL+B, 0x02 */ + _CONTROL, /* CTRL+C, 0x03 */ + _CONTROL, /* CTRL+D, 0x04 */ + _CONTROL, /* CTRL+E, 0x05 */ + _CONTROL, /* CTRL+F, 0x06 */ + _CONTROL, /* CTRL+G, 0x07 */ + _CONTROL, /* CTRL+H, 0x08 */ + _BLANK | _CONTROL | _SPACE, /* CTRL+I, 0x09 */ + _CONTROL | _SPACE, /* CTRL+J, 0x0a */ + _CONTROL | _SPACE, /* CTRL+K, 0x0b */ + _CONTROL | _SPACE, /* CTRL+L, 0x0c */ + _CONTROL | _SPACE, /* CTRL+M, 0x0d */ + _CONTROL, /* CTRL+N, 0x0e */ + _CONTROL, /* CTRL+O, 0x0f */ + _CONTROL, /* CTRL+P, 0x10 */ + _CONTROL, /* CTRL+Q, 0x11 */ + _CONTROL, /* CTRL+R, 0x12 */ + _CONTROL, /* CTRL+S, 0x13 */ + _CONTROL, /* CTRL+T, 0x14 */ + _CONTROL, /* CTRL+U, 0x15 */ + _CONTROL, /* CTRL+V, 0x16 */ + _CONTROL, /* CTRL+W, 0x17 */ + _CONTROL, /* CTRL+X, 0x18 */ + _CONTROL, /* CTRL+Y, 0x19 */ + _CONTROL, /* CTRL+Z, 0x1a */ + _CONTROL, /* CTRL+[, 0x1b */ + _CONTROL, /* CTRL+\, 0x1c */ + _CONTROL, /* CTRL+], 0x1d */ + _CONTROL, /* CTRL+^, 0x1e */ + _CONTROL, /* CTRL+_, 0x1f */ + _SPACE | _BLANK, /* ` ', 0x20 */ + _PUNCT, /* `!', 0x21 */ + _PUNCT, /* 0x22 */ + _PUNCT, /* `#', 0x23 */ + _PUNCT, /* `$', 0x24 */ + _PUNCT, /* `%', 0x25 */ + _PUNCT, /* `&', 0x26 */ + _PUNCT, /* 0x27 */ + _PUNCT, /* `(', 0x28 */ + _PUNCT, /* `)', 0x29 */ + _PUNCT, /* `*', 0x2a */ + _PUNCT, /* `+', 0x2b */ + _PUNCT, /* `,', 0x2c */ + _PUNCT, /* `-', 0x2d */ + _PUNCT, /* `.', 0x2e */ + _PUNCT, /* `/', 0x2f */ + _DIGIT | _HEX, /* `0', 0x30 */ + _DIGIT | _HEX, /* `1', 0x31 */ + _DIGIT | _HEX, /* `2', 0x32 */ + _DIGIT | _HEX, /* `3', 0x33 */ + _DIGIT | _HEX, /* `4', 0x34 */ + _DIGIT | _HEX, /* `5', 0x35 */ + _DIGIT | _HEX, /* `6', 0x36 */ + _DIGIT | _HEX, /* `7', 0x37 */ + _DIGIT | _HEX, /* `8', 0x38 */ + _DIGIT | _HEX, /* `9', 0x39 */ + _PUNCT, /* `:', 0x3a */ + _PUNCT, /* `;', 0x3b */ + _PUNCT, /* `<', 0x3c */ + _PUNCT, /* `=', 0x3d */ + _PUNCT, /* `>', 0x3e */ + _PUNCT, /* `?', 0x3f */ + _PUNCT, /* `@', 0x40 */ + 0x0100 | _UPPER | _HEX, /* `A', 0x41 */ + 0x0100 | _UPPER | _HEX, /* `B', 0x42 */ + 0x0100 | _UPPER | _HEX, /* `C', 0x43 */ + 0x0100 | _UPPER | _HEX, /* `D', 0x44 */ + 0x0100 | _UPPER | _HEX, /* `E', 0x45 */ + 0x0100 | _UPPER | _HEX, /* `F', 0x46 */ + 0x0100 | _UPPER, /* `G', 0x47 */ + 0x0100 | _UPPER, /* `H', 0x48 */ + 0x0100 | _UPPER, /* `I', 0x49 */ + 0x0100 | _UPPER, /* `J', 0x4a */ + 0x0100 | _UPPER, /* `K', 0x4b */ + 0x0100 | _UPPER, /* `L', 0x4c */ + 0x0100 | _UPPER, /* `M', 0x4d */ + 0x0100 | _UPPER, /* `N', 0x4e */ + 0x0100 | _UPPER, /* `O', 0x4f */ + 0x0100 | _UPPER, /* `P', 0x50 */ + 0x0100 | _UPPER, /* `Q', 0x51 */ + 0x0100 | _UPPER, /* `R', 0x52 */ + 0x0100 | _UPPER, /* `S', 0x53 */ + 0x0100 | _UPPER, /* `T', 0x54 */ + 0x0100 | _UPPER, /* `U', 0x55 */ + 0x0100 | _UPPER, /* `V', 0x56 */ + 0x0100 | _UPPER, /* `W', 0x57 */ + 0x0100 | _UPPER, /* `X', 0x58 */ + 0x0100 | _UPPER, /* `Y', 0x59 */ + 0x0100 | _UPPER, /* `Z', 0x5a */ + _PUNCT, /* `[', 0x5b */ + _PUNCT, /* 0x5c */ + _PUNCT, /* `]', 0x5d */ + _PUNCT, /* `^', 0x5e */ + _PUNCT, /* `_', 0x5f */ + _PUNCT, /* 0x60 */ + 0x0100 | _LOWER | _HEX, /* `a', 0x61 */ + 0x0100 | _LOWER | _HEX, /* `b', 0x62 */ + 0x0100 | _LOWER | _HEX, /* `c', 0x63 */ + 0x0100 | _LOWER | _HEX, /* `d', 0x64 */ + 0x0100 | _LOWER | _HEX, /* `e', 0x65 */ + 0x0100 | _LOWER | _HEX, /* `f', 0x66 */ + 0x0100 | _LOWER, /* `g', 0x67 */ + 0x0100 | _LOWER, /* `h', 0x68 */ + 0x0100 | _LOWER, /* `i', 0x69 */ + 0x0100 | _LOWER, /* `j', 0x6a */ + 0x0100 | _LOWER, /* `k', 0x6b */ + 0x0100 | _LOWER, /* `l', 0x6c */ + 0x0100 | _LOWER, /* `m', 0x6d */ + 0x0100 | _LOWER, /* `n', 0x6e */ + 0x0100 | _LOWER, /* `o', 0x6f */ + 0x0100 | _LOWER, /* `p', 0x70 */ + 0x0100 | _LOWER, /* `q', 0x71 */ + 0x0100 | _LOWER, /* `r', 0x72 */ + 0x0100 | _LOWER, /* `s', 0x73 */ + 0x0100 | _LOWER, /* `t', 0x74 */ + 0x0100 | _LOWER, /* `u', 0x75 */ + 0x0100 | _LOWER, /* `v', 0x76 */ + 0x0100 | _LOWER, /* `w', 0x77 */ + 0x0100 | _LOWER, /* `x', 0x78 */ + 0x0100 | _LOWER, /* `y', 0x79 */ + 0x0100 | _LOWER, /* `z', 0x7a */ + _PUNCT, /* `{', 0x7b */ + _PUNCT, /* `|', 0x7c */ + _PUNCT, /* `}', 0x7d */ + _PUNCT, /* `~', 0x7e */ + _CONTROL, /* 0x7f */ + _CONTROL, /* 0x80 */ + _CONTROL, /* 0x81 */ + _CONTROL, /* 0x82 */ + _CONTROL, /* 0x83 */ + _CONTROL, /* 0x84 */ + _CONTROL, /* 0x85 */ + _CONTROL, /* 0x86 */ + _CONTROL, /* 0x87 */ + _CONTROL, /* 0x88 */ + _CONTROL, /* 0x89 */ + _CONTROL, /* 0x8a */ + _CONTROL, /* 0x8b */ + _CONTROL, /* 0x8c */ + _CONTROL, /* 0x8d */ + _CONTROL, /* 0x8e */ + _CONTROL, /* 0x8f */ + _CONTROL, /* 0x90 */ + _CONTROL, /* 0x91 */ + _CONTROL, /* 0x92 */ + _CONTROL, /* 0x93 */ + _CONTROL, /* 0x94 */ + _CONTROL, /* 0x95 */ + _CONTROL, /* 0x96 */ + _CONTROL, /* 0x97 */ + _CONTROL, /* 0x98 */ + _CONTROL, /* 0x99 */ + _CONTROL, /* 0x9a */ + _CONTROL, /* 0x9b */ + _CONTROL, /* 0x9c */ + _CONTROL, /* 0x9d */ + _CONTROL, /* 0x9e */ + _CONTROL, /* 0x9f */ + _BLANK | _SPACE, /* 0xa0 */ + _PUNCT, /* 0xa1 */ + _PUNCT, /* 0xa2 */ + _PUNCT, /* 0xa3 */ + _PUNCT, /* 0xa4 */ + _PUNCT, /* 0xa5 */ + _PUNCT, /* 0xa6 */ + _PUNCT, /* 0xa7 */ + _PUNCT, /* 0xa8 */ + _PUNCT, /* 0xa9 */ + _PUNCT, /* 0xaa */ + _PUNCT, /* 0xab */ + _PUNCT, /* 0xac */ + _PUNCT, /* 0xad */ + _PUNCT, /* 0xae */ + _PUNCT, /* 0xaf */ + _PUNCT, /* 0xb0 */ + _PUNCT, /* 0xb1 */ + _PUNCT | _DIGIT, /* 0xb2 */ + _PUNCT | _DIGIT, /* 0xb3 */ + _PUNCT, /* 0xb4 */ + _PUNCT, /* 0xb5 */ + _PUNCT, /* 0xb6 */ + _PUNCT, /* 0xb7 */ + _PUNCT, /* 0xb8 */ + _PUNCT | _DIGIT, /* 0xb9 */ + _PUNCT, /* 0xba */ + _PUNCT, /* 0xbb */ + _PUNCT, /* 0xbc */ + _PUNCT, /* 0xbd */ + _PUNCT, /* 0xbe */ + _PUNCT, /* 0xbf */ + 0x0100 | _UPPER, /* 0xc0 */ + 0x0100 | _UPPER, /* 0xc1 */ + 0x0100 | _UPPER, /* 0xc2 */ + 0x0100 | _UPPER, /* 0xc3 */ + 0x0100 | _UPPER, /* 0xc4 */ + 0x0100 | _UPPER, /* 0xc5 */ + 0x0100 | _UPPER, /* 0xc6 */ + 0x0100 | _UPPER, /* 0xc7 */ + 0x0100 | _UPPER, /* 0xc8 */ + 0x0100 | _UPPER, /* 0xc9 */ + 0x0100 | _UPPER, /* 0xca */ + 0x0100 | _UPPER, /* 0xcb */ + 0x0100 | _UPPER, /* 0xcc */ + 0x0100 | _UPPER, /* 0xcd */ + 0x0100 | _UPPER, /* 0xce */ + 0x0100 | _UPPER, /* 0xcf */ + 0x0100 | _UPPER, /* 0xd0 */ + 0x0100 | _UPPER, /* 0xd1 */ + 0x0100 | _UPPER, /* 0xd2 */ + 0x0100 | _UPPER, /* 0xd3 */ + 0x0100 | _UPPER, /* 0xd4 */ + 0x0100 | _UPPER, /* 0xd5 */ + 0x0100 | _UPPER, /* 0xd6 */ + _PUNCT, /* 0xd7 */ + 0x0100 | _UPPER, /* 0xd8 */ + 0x0100 | _UPPER, /* 0xd9 */ + 0x0100 | _UPPER, /* 0xda */ + 0x0100 | _UPPER, /* 0xdb */ + 0x0100 | _UPPER, /* 0xdc */ + 0x0100 | _UPPER, /* 0xdd */ + 0x0100 | _UPPER, /* 0xde */ + 0x0100 | _LOWER, /* 0xdf */ + 0x0100 | _LOWER, /* 0xe0 */ + 0x0100 | _LOWER, /* 0xe1 */ + 0x0100 | _LOWER, /* 0xe2 */ + 0x0100 | _LOWER, /* 0xe3 */ + 0x0100 | _LOWER, /* 0xe4 */ + 0x0100 | _LOWER, /* 0xe5 */ + 0x0100 | _LOWER, /* 0xe6 */ + 0x0100 | _LOWER, /* 0xe7 */ + 0x0100 | _LOWER, /* 0xe8 */ + 0x0100 | _LOWER, /* 0xe9 */ + 0x0100 | _LOWER, /* 0xea */ + 0x0100 | _LOWER, /* 0xeb */ + 0x0100 | _LOWER, /* 0xec */ + 0x0100 | _LOWER, /* 0xed */ + 0x0100 | _LOWER, /* 0xee */ + 0x0100 | _LOWER, /* 0xef */ + 0x0100 | _LOWER, /* 0xf0 */ + 0x0100 | _LOWER, /* 0xf1 */ + 0x0100 | _LOWER, /* 0xf2 */ + 0x0100 | _LOWER, /* 0xf3 */ + 0x0100 | _LOWER, /* 0xf4 */ + 0x0100 | _LOWER, /* 0xf5 */ + 0x0100 | _LOWER, /* 0xf6 */ + _PUNCT, /* 0xf7 */ + 0x0100 | _LOWER, /* 0xf8 */ + 0x0100 | _LOWER, /* 0xf9 */ + 0x0100 | _LOWER, /* 0xfa */ + 0x0100 | _LOWER, /* 0xfb */ + 0x0100 | _LOWER, /* 0xfc */ + 0x0100 | _LOWER, /* 0xfd */ + 0x0100 | _LOWER, /* 0xfe */ + 0x0100 | _LOWER /* 0xff */ +}; const unsigned short *_pctype = _ctype + 1; -const unsigned short *_pwctype = _ctype + 1; +const unsigned short *_pwctype = _wctype + 1; /* * @implemented @@ -300,12 +559,22 @@ return &_pctype; } +const unsigned short* __cdecl __pctype_func(void) +{ + return _pctype; +} + /* * @implemented */ const unsigned short **__p__pwctype(void) { return &_pwctype; +} + +const unsigned short* __cdecl __pwctype_func(void) +{ + return _pwctype; } int _isctype (int c, int ctypeFlags)
14 years, 9 months
1
0
0
0
[tkreuzer] 46503: Fix definition of _wctype
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Mar 27 23:58:37 2010 New Revision: 46503 URL:
http://svn.reactos.org/svn/reactos?rev=46503&view=rev
Log: Fix definition of _wctype Modified: trunk/reactos/include/crt/ctype.h Modified: trunk/reactos/include/crt/ctype.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/ctype.h?rev=46…
============================================================================== --- trunk/reactos/include/crt/ctype.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/ctype.h [iso-8859-1] Sat Mar 27 23:58:37 2010 @@ -38,7 +38,7 @@ #ifndef _CRT_WCTYPEDATA_DEFINED #define _CRT_WCTYPEDATA_DEFINED # ifndef _CTYPE_DISABLE_MACROS - _CRTDATA(extern unsigned short *_wctype); + _CRTDATA(extern const unsigned short _wctype[]); _CRTIMP const wctype_t * __cdecl __pwctype_func(void); # ifndef _M_CEE_PURE _CRTDATA(extern const wctype_t *_pwctype);
14 years, 9 months
1
0
0
0
[tkreuzer] 46502: [MSVCRT] - enable exports for __pctype_func, __pwctype_func, _wctype
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Mar 27 23:38:22 2010 New Revision: 46502 URL:
http://svn.reactos.org/svn/reactos?rev=46502&view=rev
Log: [MSVCRT] - enable exports for __pctype_func, __pwctype_func, _wctype Modified: branches/ros-amd64-bringup/reactos/dll/win32/msvcrt/msvcrt-amd64.def branches/ros-amd64-bringup/reactos/dll/win32/msvcrt/msvcrt-i386.def Modified: branches/ros-amd64-bringup/reactos/dll/win32/msvcrt/msvcrt-amd64.def URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/w…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/msvcrt/msvcrt-amd64.def [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/msvcrt/msvcrt-amd64.def [iso-8859-1] Sat Mar 27 23:38:22 2010 @@ -158,9 +158,9 @@ __p__winminor @153 __p__winver @154 __p__wpgmptr @155 -; __pctype_func @156 + __pctype_func @156 __pioinfo @157 DATA -; __pwctype_func @158 + __pwctype_func @158 __pxcptinfoptrs @159 __set_app_type @160 __setlc_active @161 DATA @@ -583,7 +583,7 @@ _wcsupr @576 _wctime @577 ; _wctime64 @578 -; _wctype @579 + _wctype @579 _wenviron @580 DATA _wexecl @581 _wexecle @582 Modified: branches/ros-amd64-bringup/reactos/dll/win32/msvcrt/msvcrt-i386.def URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/w…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/win32/msvcrt/msvcrt-i386.def [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/win32/msvcrt/msvcrt-i386.def [iso-8859-1] Sat Mar 27 23:38:22 2010 @@ -158,9 +158,9 @@ __p__winminor @153 __p__winver @154 __p__wpgmptr @155 -; __pctype_func @156 + __pctype_func @156 __pioinfo @157 DATA -; __pwctype_func @158 + __pwctype_func @158 __pxcptinfoptrs @159 __set_app_type @160 __setlc_active @161 DATA @@ -583,7 +583,7 @@ _wcsupr @576 _wctime @577 ; _wctime64 @578 -; _wctype @579 + _wctype @579 _wenviron @580 DATA _wexecl @581 _wexecle @582
14 years, 9 months
1
0
0
0
[akhaldi] 46501: [PSDK] - Add several missing mswsockdef.h definitions. - mswsock.h : Introduce pragma once, apply consistent formatting, improve several existing definitions, remove some unrelated ones and add several missing ones.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Mar 27 23:06:39 2010 New Revision: 46501 URL:
http://svn.reactos.org/svn/reactos?rev=46501&view=rev
Log: [PSDK] - Add several missing mswsockdef.h definitions. - mswsock.h : Introduce pragma once, apply consistent formatting, improve several existing definitions, remove some unrelated ones and add several missing ones. Added: branches/header-work/include/psdk/mswsockdef.h (with props) Modified: branches/header-work/include/psdk/mswsock.h Modified: branches/header-work/include/psdk/mswsock.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/mswsoc…
============================================================================== --- branches/header-work/include/psdk/mswsock.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/mswsock.h [iso-8859-1] Sat Mar 27 23:06:39 2010 @@ -9,113 +9,345 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -#ifndef _MSWSOCK_H -#define _MSWSOCK_H +#pragma once #ifdef __cplusplus extern "C" { #endif -#define SO_CONNDATA 0x7000 -#define SO_CONNOPT 0x7001 -#define SO_DISCDATA 0x7002 -#define SO_DISCOPT 0x7003 -#define SO_CONNDATALEN 0x7004 -#define SO_CONNOPTLEN 0x7005 -#define SO_DISCDATALEN 0x7006 -#define SO_DISCOPTLEN 0x7007 -#define SO_OPENTYPE 0x7008 -#define SO_SYNCHRONOUS_ALERT 0x10 -#define SO_SYNCHRONOUS_NONALERT 0x20 -#define SO_MAXDG 0x7009 -#define SO_MAXPATHDG 0x700A -#define SO_UPDATE_ACCEPT_CONTEXT 0x700B -#define SO_CONNECT_TIME 0x700C -#define TCP_BSDURGENT 0x7000 - -#define TF_DISCONNECT 1 -#define TF_REUSE_SOCKET 2 -#define TF_WRITE_BEHIND 4 -#define TF_USE_DEFAULT_WORKER 0 -#define TF_USE_SYSTEM_THREAD 16 -#define TF_USE_KERNEL_APC 32 +#include <mswsockdef.h> + +#define SO_CONNDATA 0x7000 +#define SO_CONNOPT 0x7001 +#define SO_DISCDATA 0x7002 +#define SO_DISCOPT 0x7003 +#define SO_CONNDATALEN 0x7004 +#define SO_CONNOPTLEN 0x7005 +#define SO_DISCDATALEN 0x7006 +#define SO_DISCOPTLEN 0x7007 +#define SO_OPENTYPE 0x7008 +#define SO_SYNCHRONOUS_ALERT 0x10 +#define SO_SYNCHRONOUS_NONALERT 0x20 +#define SO_MAXDG 0x7009 +#define SO_MAXPATHDG 0x700A +#define SO_UPDATE_ACCEPT_CONTEXT 0x700B +#define SO_CONNECT_TIME 0x700C +#if(_WIN32_WINNT >= 0x0501) +#define SO_UPDATE_CONNECT_CONTEXT 0x7010 +#endif + +#define TCP_BSDURGENT 0x7000 + +#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12) + +#if((_WIN32_WINNT < 0x0600) && (_WIN32_WINNT >= 0x0501)) +#define SIO_SOCKET_CLOSE_NOTIFY _WSAIOW(IOC_VENDOR,13) +#endif + +#define SIO_UDP_NETRESET _WSAIOW(IOC_VENDOR,15) + +#define TF_DISCONNECT 1 +#define TF_REUSE_SOCKET 2 +#define TF_WRITE_BEHIND 4 + +#define TF_USE_DEFAULT_WORKER 0 +#define TF_USE_SYSTEM_THREAD 16 +#define TF_USE_KERNEL_APC 32 + +#if(_WIN32_WINNT >= 0x0501) +#define TP_ELEMENT_MEMORY 1 +#define TP_ELEMENT_FILE 2 +#define TP_ELEMENT_EOP 4 +#endif + +#define TP_DISCONNECT TF_DISCONNECT +#define TP_REUSE_SOCKET TF_REUSE_SOCKET +#define TP_USE_DEFAULT_WORKER TF_USE_DEFAULT_WORKER +#define TP_USE_SYSTEM_THREAD TF_USE_SYSTEM_THREAD +#define TP_USE_KERNEL_APC TF_USE_KERNEL_APC + +#define WSAID_TRANSMITFILE \ + {0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}} + +#define WSAID_ACCEPTEX \ + {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}} + +#define WSAID_GETACCEPTEXSOCKADDRS \ + {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}} typedef struct _TRANSMIT_FILE_BUFFERS { - PVOID Head; - DWORD HeadLength; - PVOID Tail; - DWORD TailLength; -} TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS; - -int PASCAL WSARecvEx(SOCKET,char*,int,int*); -BOOL PASCAL TransmitFile(SOCKET,HANDLE,DWORD,DWORD,LPOVERLAPPED,LPTRANSMIT_FILE_BUFFERS,DWORD); -BOOL PASCAL AcceptEx(SOCKET,SOCKET,PVOID,DWORD,DWORD,DWORD,LPDWORD,LPOVERLAPPED); -VOID PASCAL GetAcceptExSockaddrs(PVOID,DWORD,DWORD,DWORD,struct sockaddr**, LPINT, struct sockaddr**, LPINT); - -#define WSAID_ACCEPTEX { 0xB5367DF0, 0xCBAC, 0x11CF, { 0x95, 0xCA, 0x00, 0x80, 0x5F, 0x48, 0xA1, 0x92 } } -#define WSAID_TRANSMITFILE { 0xB5367DF1, 0xCBAC, 0x11CF, { 0x95, 0xCA, 0x00, 0x80, 0x5F, 0x48, 0xA1, 0x92 } } -#define WSAID_GETACCEPTEXSOCKADDRS { 0xB5367DF2, 0xCBAC, 0x11CF, { 0x95, 0xCA, 0x00, 0x80, 0x5F, 0x48, 0xA1, 0x92 } } - -#define NLA_NAMESPACE_GUID { 0x6642243A, 0x3BA8, 0x4AA6, { 0xBA, 0xA5, 0x2E, 0xB, 0xD7, 0x1F, 0xDD, 0x83 } } - -typedef BOOL (PASCAL *LPFN_TRANSMITFILE)(SOCKET,HANDLE,DWORD,DWORD,LPOVERLAPPED,LPTRANSMIT_FILE_BUFFERS,DWORD); -typedef BOOL (PASCAL *LPFN_ACCEPTEX)(SOCKET,SOCKET,PVOID,DWORD,DWORD,DWORD,LPDWORD,LPOVERLAPPED); -typedef VOID (PASCAL *LPFN_GETACCEPTEXSOCKADDRS)(PVOID,DWORD,DWORD,DWORD,struct sockaddr**, LPINT, struct sockaddr**, LPINT); - -#ifdef _WINSOCK2_H /* These require the winsock2 interface. */ - -#define TP_ELEMENT_FILE 1 -#define TP_ELEMENT_MEMORY 2 -#define TP_ELEMENT_EOP 4 + LPVOID Head; + DWORD HeadLength; + LPVOID Tail; + DWORD TailLength; +} TRANSMIT_FILE_BUFFERS, *PTRANSMIT_FILE_BUFFERS, FAR *LPTRANSMIT_FILE_BUFFERS; + +typedef BOOL +(PASCAL FAR *LPFN_TRANSMITFILE)( + IN SOCKET hSocket, + IN HANDLE hFile, + IN DWORD nNumberOfBytesToWrite, + IN DWORD nNumberOfBytesPerSend, + IN OUT LPOVERLAPPED lpOverlapped OPTIONAL, + IN LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers OPTIONAL, + IN DWORD dwReserved); + +typedef BOOL +(PASCAL FAR *LPFN_ACCEPTEX)( + IN SOCKET sListenSocket, + IN SOCKET sAcceptSocket, + IN PVOID lpOutputBuffer, + IN DWORD dwReceiveDataLength, + IN DWORD dwLocalAddressLength, + IN DWORD dwRemoteAddressLength, + OUT LPDWORD lpdwBytesReceived, + IN OUT LPOVERLAPPED lpOverlapped); + +typedef VOID +(PASCAL FAR *LPFN_GETACCEPTEXSOCKADDRS)( + IN PVOID lpOutputBuffer, + IN DWORD dwReceiveDataLength, + IN DWORD dwLocalAddressLength, + IN DWORD dwRemoteAddressLength, + OUT struct sockaddr **LocalSockaddr, + OUT LPINT LocalSockaddrLength, + OUT struct sockaddr **RemoteSockaddr, + OUT LPINT RemoteSockaddrLength); + +#if(_WIN32_WINNT >= 0x0501) typedef struct _TRANSMIT_PACKETS_ELEMENT { - ULONG dwElFlags; - ULONG cLength; - _ANONYMOUS_UNION - union { - struct { - LARGE_INTEGER nFileOffset; - HANDLE hFile; - }; - PVOID pBuffer; - }; -} TRANSMIT_PACKETS_ELEMENT; - -typedef struct _WSAMSG { - LPSOCKADDR name; - INT namelen; - LPWSABUF lpBuffers; - DWORD dwBufferCount; - WSABUF Control; - DWORD dwFlags; -} WSAMSG, *PWSAMSG, *LPWSAMSG; - - -/* According to MSDN docs, the WSAMSG.Control buffer starts with a - cmsghdr header of the following form. See also RFC 2292. */ - -typedef struct wsacmsghdr { - UINT cmsg_len; - INT cmsg_level; - INT cmsg_type; - /* followed by UCHAR cmsg_data[]; */ -} WSACMSGHDR; - -/* TODO: Standard Posix.1g macros as per RFC 2292, with WSA_uglification. */ -#if 0 -#define WSA_CMSG_FIRSTHDR(mhdr) -#define WSA_CMSG_NXTHDR(mhdr, cmsg) -#define WSA_CMSG_SPACE(length) -#define WSA_CMSG_LEN(length) -#endif - -BOOL PASCAL DisconnectEx(SOCKET,LPOVERLAPPED,DWORD,DWORD); -int PASCAL WSARecvMsg(SOCKET,LPWSAMSG,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); - -#endif /* _WINSOCK2_H */ + ULONG dwElFlags; + ULONG cLength; + union { + struct { + LARGE_INTEGER nFileOffset; + HANDLE hFile; + }; + PVOID pBuffer; + }; +} TRANSMIT_PACKETS_ELEMENT, *PTRANSMIT_PACKETS_ELEMENT, FAR *LPTRANSMIT_PACKETS_ELEMENT; + +typedef BOOL +(PASCAL FAR *LPFN_TRANSMITPACKETS)( + IN SOCKET hSocket, + IN LPTRANSMIT_PACKETS_ELEMENT lpPacketArray OPTIONAL, + IN DWORD nElementCount, + IN DWORD nSendSize, + IN OUT LPOVERLAPPED lpOverlapped OPTIONAL, + IN DWORD dwFlags); + +#define WSAID_TRANSMITPACKETS \ + {0xd9689da0,0x1f90,0x11d3,{0x99,0x71,0x00,0xc0,0x4f,0x68,0xc8,0x76}} + +typedef BOOL +(PASCAL FAR *LPFN_CONNECTEX)( + IN SOCKET s, + IN const struct sockaddr FAR *name, + IN int namelen, + IN PVOID lpSendBuffer OPTIONAL, + IN DWORD dwSendDataLength, + OUT LPDWORD lpdwBytesSent, + IN OUT LPOVERLAPPED lpOverlapped); + +#define WSAID_CONNECTEX \ + {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}} + +typedef BOOL +(PASCAL FAR *LPFN_DISCONNECTEX)( + IN SOCKET s, + IN OUT LPOVERLAPPED lpOverlapped OPTIONAL, + IN DWORD dwFlags, + IN DWORD dwReserved); + +#define WSAID_DISCONNECTEX \ + {0x7fda2e11,0x8630,0x436f,{0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}} + +#define DE_REUSE_SOCKET TF_REUSE_SOCKET + +#define NLA_NAMESPACE_GUID \ + {0x6642243a,0x3ba8,0x4aa6,{0xba,0xa5,0x2e,0xb,0xd7,0x1f,0xdd,0x83}} + +#define NLA_SERVICE_CLASS_GUID \ + {0x37e515,0xb5c9,0x4a43,{0xba,0xda,0x8b,0x48,0xa8,0x7a,0xd2,0x39}} + +#define NLA_ALLUSERS_NETWORK 0x00000001 +#define NLA_FRIENDLY_NAME 0x00000002 + +typedef enum _NLA_BLOB_DATA_TYPE { + NLA_RAW_DATA = 0, + NLA_INTERFACE = 1, + NLA_802_1X_LOCATION = 2, + NLA_CONNECTIVITY = 3, + NLA_ICS = 4, +} NLA_BLOB_DATA_TYPE, *PNLA_BLOB_DATA_TYPE; + +typedef enum _NLA_CONNECTIVITY_TYPE { + NLA_NETWORK_AD_HOC = 0, + NLA_NETWORK_MANAGED = 1, + NLA_NETWORK_UNMANAGED = 2, + NLA_NETWORK_UNKNOWN = 3, +} NLA_CONNECTIVITY_TYPE, *PNLA_CONNECTIVITY_TYPE; + +typedef enum _NLA_INTERNET { + NLA_INTERNET_UNKNOWN = 0, + NLA_INTERNET_NO = 1, + NLA_INTERNET_YES = 2, +} NLA_INTERNET, *PNLA_INTERNET; + +typedef struct _NLA_BLOB { + struct { + NLA_BLOB_DATA_TYPE type; + DWORD dwSize; + DWORD nextOffset; + } header; + union { + CHAR rawData[1]; + struct { + DWORD dwType; + DWORD dwSpeed; + CHAR adapterName[1]; + } interfaceData; + struct { + CHAR information[1]; + } locationData; + struct { + NLA_CONNECTIVITY_TYPE type; + NLA_INTERNET internet; + } connectivity; + struct { + struct { + DWORD speed; + DWORD type; + DWORD state; + WCHAR machineName[256]; + WCHAR sharedAdapterName[256]; + } remote; + } ICS; + } data; +} NLA_BLOB, *PNLA_BLOB, * FAR LPNLA_BLOB; + +typedef INT +(PASCAL FAR *LPFN_WSARECVMSG)( + IN SOCKET s, + IN OUT LPWSAMSG lpMsg, + OUT LPDWORD lpdwNumberOfBytesRecvd OPTIONAL, + IN OUT LPWSAOVERLAPPED lpOverlapped OPTIONAL, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL); + +#define WSAID_WSARECVMSG \ + {0xf689d7c8,0x6f1f,0x436b,{0x8a,0x53,0xe5,0x4f,0xe3,0x51,0xc3,0x22}} + +#endif /* (_WIN32_WINNT >= 0x0501) */ + +#if(_WIN32_WINNT >= 0x0600) + +#define SIO_BSP_HANDLE _WSAIOR(IOC_WS2,27) +#define SIO_BSP_HANDLE_SELECT _WSAIOR(IOC_WS2,28) +#define SIO_BSP_HANDLE_POLL _WSAIOR(IOC_WS2,29) + +#define SIO_BASE_HANDLE _WSAIOR(IOC_WS2,34) + +#define SIO_EXT_SELECT _WSAIORW(IOC_WS2,30) +#define SIO_EXT_POLL _WSAIORW(IOC_WS2,31) +#define SIO_EXT_SENDMSG _WSAIORW(IOC_WS2,32) + +typedef struct { + int result; + ULONG fds; + INT timeout; + WSAPOLLFD fdArray[0]; +} WSAPOLLDATA, *LPWSAPOLLDATA; + +typedef struct { + LPWSAMSG lpMsg; + DWORD dwFlags; + LPDWORD lpNumberOfBytesSent; + LPWSAOVERLAPPED lpOverlapped; + LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine; +} WSASENDMSG, *LPWSASENDMSG; + +typedef INT +(PASCAL FAR *LPFN_WSASENDMSG)( + IN SOCKET s, + IN LPWSAMSG lpMsg, + IN DWORD dwFlags, + OUT LPDWORD lpNumberOfBytesSent OPTIONAL, + IN OUT LPWSAOVERLAPPED lpOverlapped OPTIONAL, + IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL); + +#define WSAID_WSASENDMSG + {0xa441e712,0x754f,0x43ca,{0x84,0xa7,0x0d,0xee,0x44,0xcf,0x60,0x6d}} + +typedef INT +(WSAAPI *LPFN_WSAPOLL)( + IN OUT LPWSAPOLLFD fdarray, + IN ULONG nfds, + IN INT timeout); + +#define WSAID_WSAPOLL \ + {0x18C76F85,0xDC66,0x4964,{0x97,0x2E,0x23,0xC2,0x72,0x38,0x31,0x2B}} + +#endif /* (_WIN32_WINNT >= 0x0600) */ + +#if(_WIN32_WINNT < 0x0600) +int +PASCAL +FAR +WSARecvEx( + IN SOCKET s, + OUT char FAR *buf, + IN int len, + IN OUT int FAR *flags); +#else //(_WIN32_WINNT < 0x0600) +INT +PASCAL +FAR +WSARecvEx( + IN SOCKET s, + OUT CHAR FAR *buf, + IN INT len, + IN OUT INT FAR *flags); +#endif //(_WIN32_WINNT < 0x0600) + +BOOL +PASCAL +FAR +TransmitFile( + IN SOCKET hSocket, + IN HANDLE hFile, + IN DWORD nNumberOfBytesToWrite, + IN DWORD nNumberOfBytesPerSend, + IN OUT LPOVERLAPPED lpOverlapped OPTIONAL, + IN LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers OPTIONAL, + IN DWORD dwReserved); + +BOOL +PASCAL +FAR +AcceptEx( + IN SOCKET sListenSocket, + IN SOCKET sAcceptSocket, + OUT PVOID lpOutputBuffer, + IN DWORD dwReceiveDataLength, + IN DWORD dwLocalAddressLength, + IN DWORD dwRemoteAddressLength, + OUT LPDWORD lpdwBytesReceived, + IN OUT LPOVERLAPPED lpOverlapped); + +VOID +PASCAL +FAR +GetAcceptExSockaddrs( + IN PVOID lpOutputBuffer, + IN DWORD dwReceiveDataLength, + IN DWORD dwLocalAddressLength, + IN DWORD dwRemoteAddressLength, + OUT struct sockaddr **LocalSockaddr, + OUT LPINT LocalSockaddrLength, + OUT struct sockaddr **RemoteSockaddr, + OUT LPINT RemoteSockaddrLength); #ifdef __cplusplus } #endif -#endif /* _MSWSOCK_H */ - Added: branches/header-work/include/psdk/mswsockdef.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/mswsoc…
============================================================================== --- branches/header-work/include/psdk/mswsockdef.h (added) +++ branches/header-work/include/psdk/mswsockdef.h [iso-8859-1] Sat Mar 27 23:06:39 2010 @@ -1,0 +1,66 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#if(_WIN32_WINNT >= 0x0600) +#ifdef _MSC_VER +#define MSWSOCKDEF_INLINE __inline +#else +#define MSWSOCKDEF_INLINE extern inline +#endif +#endif /* (_WIN32_WINNT>=0x0600) */ + +#ifndef ASSERT +#define MSWSOCKDEF_ASSERT_UNDEFINED +#define ASSERT(exp) ((VOID) 0) +#endif + +#if(_WIN32_WINNT >= 0x0600) + +#ifdef _WS2DEF_ + +extern CONST UCHAR sockaddr_size[AF_MAX]; + +MSWSOCKDEF_INLINE +UCHAR +SOCKADDR_SIZE( + IN ADDRESS_FAMILY af) +{ + return (UCHAR)((af < AF_MAX) ? sockaddr_size[af] + : sockaddr_size[AF_UNSPEC]); +} + +MSWSOCKDEF_INLINE +SCOPE_LEVEL +ScopeLevel( + IN SCOPE_ID ScopeId) +{ + return (SCOPE_LEVEL)ScopeId.Level; +} + +#endif /* _WS2DEF_ */ + +#define SIO_SET_COMPATIBILITY_MODE _WSAIOW(IOC_VENDOR,300) + +typedef enum _WSA_COMPATIBILITY_BEHAVIOR_ID { + WsaBehaviorAll = 0, + WsaBehaviorReceiveBuffering, + WsaBehaviorAutoTuning +} WSA_COMPATIBILITY_BEHAVIOR_ID, *PWSA_COMPATIBILITY_BEHAVIOR_ID; + +typedef struct _WSA_COMPATIBILITY_MODE { + WSA_COMPATIBILITY_BEHAVIOR_ID BehaviorId; + ULONG TargetOsVersion; +} WSA_COMPATIBILITY_MODE, *PWSA_COMPATIBILITY_MODE; + +#endif /* (_WIN32_WINNT>=0x0600) */ + +#ifdef MSWSOCKDEF_ASSERT_UNDEFINED +#undef ASSERT +#endif + +#ifdef __cplusplus +} +#endif Propchange: branches/header-work/include/psdk/mswsockdef.h ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 9 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
90
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
Results per page:
10
25
50
100
200