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
February 2009
----- 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
29 participants
559 discussions
Start a n
N
ew thread
[silverblade] 39717: Added GETDEVCAPS support for MIDI, mixer and aux devices, within MME Buddy and sndblst.dll - this just lets you see the device names etc. but adds no extra functionality apart from this.
by silverblade@svn.reactos.org
Author: silverblade Date: Mon Feb 23 01:31:26 2009 New Revision: 39717 URL:
http://svn.reactos.org/svn/reactos?rev=39717&view=rev
Log: Added GETDEVCAPS support for MIDI, mixer and aux devices, within MME Buddy and sndblst.dll - this just lets you see the device names etc. but adds no extra functionality apart from this. Modified: trunk/reactos/dll/win32/sndblst/sndblst.c trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c Modified: trunk/reactos/dll/win32/sndblst/sndblst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sndblst/sndblst.…
============================================================================== --- trunk/reactos/dll/win32/sndblst/sndblst.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sndblst/sndblst.c [iso-8859-1] Mon Feb 23 01:31:26 2009 @@ -20,8 +20,13 @@ #include <mment4.h> //#include <debug.h> -PWSTR SBWaveOutDeviceName = L"ROS Sound Blaster Out"; -PWSTR SBWaveInDeviceName = L"ROS Sound Blaster In"; +/* TODO: Give individual device names if someone has > 1 card */ +PWSTR SBWaveOutDeviceName = L"ROS Sound Blaster Wave Out"; +PWSTR SBWaveInDeviceName = L"ROS Sound Blaster Wave In"; +PWSTR SBMidiOutDeviceName = L"ROS Sound Blaster Midi Out"; +PWSTR SBMidiInDeviceName = L"ROS Sound Blaster Midi In"; +PWSTR SBAuxDeviceName = L"ROS Sound Blaster Aux"; +PWSTR SBMixerDeviceName = L"ROS Sound Blaster Mixer"; /* TODO: Mixer etc */ MMRESULT @@ -62,6 +67,30 @@ { LPWAVEINCAPS WaveInCaps = (LPWAVEINCAPS) Capabilities; CopyWideString(WaveInCaps->szPname, SBWaveInDeviceName); + break; + } + case MIDI_OUT_DEVICE_TYPE : + { + LPMIDIOUTCAPS MidiOutCaps = (LPMIDIOUTCAPS) Capabilities; + CopyWideString(MidiOutCaps->szPname, SBMidiOutDeviceName); + break; + } + case MIDI_IN_DEVICE_TYPE : + { + LPMIDIINCAPS MidiInCaps = (LPMIDIINCAPS) Capabilities; + CopyWideString(MidiInCaps->szPname, SBMidiInDeviceName); + break; + } + case AUX_DEVICE_TYPE : + { + LPAUXCAPS AuxCaps = (LPAUXCAPS) Capabilities; + CopyWideString(AuxCaps->szPname, SBAuxDeviceName); + break; + } + case MIXER_DEVICE_TYPE : + { + LPMIXERCAPS MixerCaps = (LPMIXERCAPS) Capabilities; + CopyWideString(MixerCaps->szPname, SBMixerDeviceName); break; } } Modified: trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c [iso-8859-1] Mon Feb 23 01:31:26 2009 @@ -54,6 +54,8 @@ if ( ! MMSUCCESS(Result) ) return TranslateInternalMmResult(Result); + SND_ASSERT( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) ); + /* Check that the capabilities structure is of a valid size */ switch ( DeviceType ) { @@ -77,10 +79,15 @@ GoodSize = CapabilitiesSize >= sizeof(MIDIINCAPS); break; } - /* TODO: Others... */ - default : + case AUX_DEVICE_TYPE : { - SND_ASSERT(FALSE); + GoodSize = CapabilitiesSize >= sizeof(AUXCAPS); + break; + } + case MIXER_DEVICE_TYPE : + { + GoodSize = CapabilitiesSize >= sizeof(MIXERCAPS); + break; } }; Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] Mon Feb 23 01:31:26 2009 @@ -60,11 +60,12 @@ SND_TRACE(L"MME *_GETCAPS for device %d of type %d\n", DeviceId, DeviceType); - /* FIXME: Validate device type and ID */ + /* FIXME: Validate device ID */ VALIDATE_MMSYS_PARAMETER( Capabilities ); - VALIDATE_MMSYS_PARAMETER( CapabilitiesSize > 0 ); + VALIDATE_MMSYS_PARAMETER( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) ); /* Our parameter checks are done elsewhere */ + Result = GetSoundDevice(DeviceType, DeviceId, &SoundDevice); if ( ! MMSUCCESS(Result) )
15 years, 10 months
1
0
0
0
[silverblade] 39716: Closing of wave output devices is functional and terminates the sound thread cleanly. Started writing code to support pause/restart (nonfunctional yet.) Stubbed mixer messages, added a readme.txt to give an overview of functions supported. Also includes partial rewrite of wdmaud.drv. Currently I am listening to DI.FM in ReactOS using an NT4 sndblst.sys along with ReactOS' sndblst.dll
by silverblade@svn.reactos.org
Author: silverblade Date: Mon Feb 23 00:14:54 2009 New Revision: 39716 URL:
http://svn.reactos.org/svn/reactos?rev=39716&view=rev
Log: Closing of wave output devices is functional and terminates the sound thread cleanly. Started writing code to support pause/restart (nonfunctional yet.) Stubbed mixer messages, added a readme.txt to give an overview of functions supported. Also includes partial rewrite of wdmaud.drv. Currently I am listening to DI.FM in ReactOS using an NT4 sndblst.sys along with ReactOS' sndblst.dll Added: trunk/reactos/lib/drivers/sound/mmebuddy/readme.txt (with props) Modified: trunk/reactos/dll/win32/sndblst/sndblst.c trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild trunk/reactos/include/reactos/libs/sound/mmebuddy.h trunk/reactos/lib/drivers/sound/mmebuddy/deviceinstance.c trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c trunk/reactos/lib/drivers/sound/mmebuddy/thread.c trunk/reactos/lib/drivers/sound/mmebuddy/wave/header.c trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c Modified: trunk/reactos/dll/win32/sndblst/sndblst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sndblst/sndblst.…
============================================================================== --- trunk/reactos/dll/win32/sndblst/sndblst.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sndblst/sndblst.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -93,6 +93,7 @@ return FALSE; /* Set up our function table */ + ZeroMemory(&FuncTable, sizeof(MMFUNCTION_TABLE)); FuncTable.GetCapabilities = GetSoundBlasterDeviceCapabilities; FuncTable.QueryWaveFormatSupport = QueryNt4WaveDeviceFormatSupport; FuncTable.SetWaveFormat = SetNt4WaveDeviceFormat; Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -18,9 +18,268 @@ #include <mmddk.h> #include <mmebuddy.h> +#include <ks.h> +#include <ksmedia.h> +#include "interface.h" + #define KERNEL_DEVICE_NAME L"\\\\Device\\wdmaud" +PWSTR UnknownWaveIn = L"Wave Input"; +PWSTR UnknownWaveOut = L"Wave Output"; +PWSTR UnknownMidiIn = L"Midi Input"; +PWSTR UnknownMidiOut = L"Midi Output"; + HANDLE KernelHandle = INVALID_HANDLE_VALUE; +DWORD OpenCount = 0; + + +MMRESULT +GetNumWdmDevs( + IN HANDLE Handle, + IN MMDEVICE_TYPE DeviceType, + OUT DWORD* DeviceCount) +{ + MMRESULT Result; + WDMAUD_DEVICE_INFO DeviceInfo; + + VALIDATE_MMSYS_PARAMETER( Handle != INVALID_HANDLE_VALUE ); + VALIDATE_MMSYS_PARAMETER( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) ); + VALIDATE_MMSYS_PARAMETER( DeviceCount ); + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.DeviceType = DeviceType; + + Result = SyncOverlappedDeviceIoControl(Handle, + IOCTL_GETNUMDEVS_TYPE, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( ! Result ) + { + *DeviceCount = 0; + return TranslateInternalMmResult(Result); + } + + *DeviceCount = DeviceInfo.DeviceCount; + + return MMSYSERR_NOERROR; +} + +MMRESULT +GetWdmDeviceCapabilities( + IN PSOUND_DEVICE SoundDevice, + OUT PVOID Capabilities, + IN DWORD CapabilitiesSize) +{ + /* NOTE - At this time, WDMAUD does not support this properly */ + + MMRESULT Result; + MMDEVICE_TYPE DeviceType; + + SND_ASSERT( SoundDevice ); + SND_ASSERT( Capabilities ); + + SND_TRACE(L"WDMAUD - GetWdmDeviceCapabilities\n"); + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + + if ( ! MMSUCCESS(Result) ) + return Result; + + /* This is pretty much a big hack right now */ + switch ( DeviceType ) + { + case WAVE_OUT_DEVICE_TYPE : + { + LPWAVEOUTCAPS WaveOutCaps = (LPWAVEOUTCAPS) Capabilities; + WaveOutCaps->wMid = 0; + WaveOutCaps->wPid = 0; + WaveOutCaps->vDriverVersion = 0x0001; + CopyWideString(WaveOutCaps->szPname, UnknownWaveOut); + + /* HACK: We may not really support all formats! */ + WaveOutCaps->dwFormats = 0xffffffff; + WaveOutCaps->wChannels = 2; + WaveOutCaps->dwSupport = 0; + break; + } + case WAVE_IN_DEVICE_TYPE : + { + LPWAVEINCAPS WaveInCaps = (LPWAVEINCAPS) Capabilities; + CopyWideString(WaveInCaps->szPname, UnknownWaveIn); + /* TODO... other fields */ + break; + } + } + + return MMSYSERR_NOERROR; +} + + +MMRESULT +OpenWdmSoundDevice( + IN struct _SOUND_DEVICE* SoundDevice, /* NOT USED */ + OUT PVOID* Handle) +{ + /* Only open this if it's not already open */ + if ( KernelHandle == INVALID_HANDLE_VALUE ) + { + KernelHandle = CreateFile(KERNEL_DEVICE_NAME, + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, + NULL); + } + + if ( KernelHandle == INVALID_HANDLE_VALUE ) + return MMSYSERR_ERROR; + + SND_ASSERT( Handle ); + + *Handle = KernelHandle; + ++ OpenCount; + + return MMSYSERR_NOERROR; +} + +MMRESULT +CloseWdmSoundDevice( + IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, /* NOT USED */ + IN PVOID Handle) +{ + SND_ASSERT( OpenCount > 0 ); + SND_ASSERT( KernelHandle != INVALID_HANDLE_VALUE ); + + -- OpenCount; + + if ( OpenCount < 1 ) + { + CloseHandle(KernelHandle); + KernelHandle = INVALID_HANDLE_VALUE; + } + + return MMSYSERR_NOERROR; +} + + +MMRESULT +QueryWdmWaveDeviceFormatSupport( + IN PSOUND_DEVICE Device, + IN PWAVEFORMATEX WaveFormat, + IN DWORD WaveFormatSize) +{ + /* Whatever... */ + return MMSYSERR_NOERROR; +} + +MMRESULT +SetWdmWaveDeviceFormat( + IN PSOUND_DEVICE_INSTANCE Instance, + IN PWAVEFORMATEX WaveFormat, + IN DWORD WaveFormatSize) +{ + MMRESULT Result; + PSOUND_DEVICE SoundDevice; + PVOID Identifier; + WDMAUD_DEVICE_INFO DeviceInfo; + + Result = GetSoundDeviceFromInstance(Instance, &SoundDevice); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + Result = GetSoundDeviceIdentifier(SoundDevice, &Identifier); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.u.WaveFormatEx.cbSize = WaveFormat->cbSize; + DeviceInfo.u.WaveFormatEx.wFormatTag = WaveFormat->wFormatTag; + DeviceInfo.u.WaveFormatEx.nChannels = WaveFormat->nChannels; + DeviceInfo.u.WaveFormatEx.nSamplesPerSec = WaveFormat->nSamplesPerSec; + DeviceInfo.u.WaveFormatEx.nBlockAlign = WaveFormat->nBlockAlign; + DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec = WaveFormat->nAvgBytesPerSec; + DeviceInfo.u.WaveFormatEx.wBitsPerSample = WaveFormat->wBitsPerSample; + + Result = SyncOverlappedDeviceIoControl(KernelHandle, + IOCTL_OPEN_WDMAUD, + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + (LPVOID) &DeviceInfo, + sizeof(WDMAUD_DEVICE_INFO), + NULL); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + return MMSYSERR_NOERROR; +} + + +MMRESULT +PopulateWdmDeviceList( + HANDLE Handle, + MMDEVICE_TYPE DeviceType) +{ + MMRESULT Result; + DWORD DeviceCount = 0; + PSOUND_DEVICE SoundDevice = NULL; + MMFUNCTION_TABLE FuncTable; + DWORD i; + + VALIDATE_MMSYS_PARAMETER( Handle != INVALID_HANDLE_VALUE ); + VALIDATE_MMSYS_PARAMETER( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) ); + + Result = GetNumWdmDevs(Handle, DeviceType, &DeviceCount); + + if ( ! MMSUCCESS(Result) ) + { + SND_ERR(L"Error %d while obtaining number of devices\n", Result); + return TranslateInternalMmResult(Result); + } + + SND_TRACE(L"%d devices of type %d found\n", DeviceCount, DeviceType); + + + for ( i = 0; i < DeviceCount; ++ i ) + { + Result = ListSoundDevice(DeviceType, (PVOID) i, &SoundDevice); + + if ( ! MMSUCCESS(Result) ) + { + SND_ERR(L"Failed to list sound device - error %d\n", Result); + return TranslateInternalMmResult(Result); + } + + /* Set up our function table */ + ZeroMemory(&FuncTable, sizeof(MMFUNCTION_TABLE)); + FuncTable.GetCapabilities = GetWdmDeviceCapabilities; + FuncTable.QueryWaveFormatSupport = QueryWdmWaveDeviceFormatSupport; + FuncTable.SetWaveFormat = SetWdmWaveDeviceFormat; + FuncTable.Open = OpenWdmSoundDevice; + FuncTable.Close = CloseWdmSoundDevice; + //FuncTable.CommitWaveBuffer = WriteFileEx_Committer; + + SetSoundDeviceFunctionTable(SoundDevice, &FuncTable); + } + + return MMSYSERR_NOERROR; +} + + APIENTRY LONG DriverProc( @@ -36,6 +295,7 @@ { case DRV_LOAD : { + HANDLE Handle; SND_TRACE(L"DRV_LOAD\n"); Result = InitEntrypointMutexes(); @@ -43,23 +303,28 @@ if ( ! MMSUCCESS(Result) ) return 0L; - KernelHandle = CreateFile(KERNEL_DEVICE_NAME, - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_WRITE, // ok? - NULL, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, - NULL); - - if ( KernelHandle == INVALID_HANDLE_VALUE ) + OpenWdmSoundDevice(NULL, &Handle); + + if ( Handle == INVALID_HANDLE_VALUE ) { SND_ERR(L"Failed to open %s\n", KERNEL_DEVICE_NAME); CleanupEntrypointMutexes(); - UnlistAllSoundDevices(); + //UnlistAllSoundDevices(); return 0L; } + + /* Populate the device lists */ + SND_TRACE(L"Populating device lists\n"); + PopulateWdmDeviceList(KernelHandle, WAVE_OUT_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, WAVE_IN_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, MIDI_OUT_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, MIDI_IN_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, AUX_DEVICE_TYPE); + PopulateWdmDeviceList(KernelHandle, MIXER_DEVICE_TYPE); + + CloseWdmSoundDevice(NULL, Handle); SND_TRACE(L"Initialisation complete\n"); Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -2,6 +2,7 @@ <importlibrary definition="wdmaud.spec" /> <include base="wdmaud.drv">.</include> <include base="ReactOS">include/reactos/libs/sound</include> + <include base="wdmaud_kernel">.</include> <define name="DEBUG_NT4" /><!-- Use custom debug routines --> <library>mmebuddy</library> <library>ntdll</library> Modified: trunk/reactos/include/reactos/libs/sound/mmebuddy.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/sound…
============================================================================== --- trunk/reactos/include/reactos/libs/sound/mmebuddy.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/libs/sound/mmebuddy.h [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -181,6 +181,7 @@ OVERLAPPED Standard; struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance; PWAVEHDR Header; + BOOL PerformCompletion; } SOUND_OVERLAPPED, *PSOUND_OVERLAPPED; typedef MMRESULT (*WAVE_COMMIT_FUNC)( @@ -314,8 +315,9 @@ }; PWAVEHDR WaveLoopStart; - PWAVEHDR CurrentWaveHeader; + //PWAVEHDR CurrentWaveHeader; DWORD OutstandingBuffers; + DWORD LoopsRemaining; } SOUND_DEVICE_INSTANCE, *PSOUND_DEVICE_INSTANCE; /* This lives in WAVEHDR.reserved */ @@ -383,6 +385,10 @@ #define MmeWriteWaveHeader(private_handle, header) \ WriteWaveHeader((PSOUND_DEVICE_INSTANCE)private_handle, (PWAVEHDR)header) +MMRESULT +MmeResetWavePlayback( + IN DWORD PrivateHandle); + /* capabilities.c @@ -619,30 +625,14 @@ IN PSOUND_OVERLAPPED Overlap, IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine); +MMRESULT +StopStreaming( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance); + /* kernel.c */ - -#if 0 -#define QueryDevice(h, ctl, o, o_size, xfer, ovl) \ - Win32ErrorToMmResult( \ - DeviceIoControl(h, ctl, NULL, 0, o, o_size, xfer, ovl) != 0 \ - ? ERROR_SUCCESS : GetLastError() \ - ) - -#define ControlDevice(h, ctl, i, i_size, xfer, ovl) \ - Win32ErrorToMmResult( \ - DeviceIoControl(h, ctl, i, i_size, NULL, 0, xfer, ovl) != 0 \ - ? ERROR_SUCCESS : GetLastError() \ - ) - -#define QuerySoundDevice(sd, ctl, o, o_size, xfer) \ - SoundDeviceIoControl(sd, ctl, NULL, 0, o, o_size, xfer) - -#define ControlSoundDevice(sd, ctl, i, i_size, xfer) \ - SoundDeviceIoControl(sd, ctl, i, i_size, NULL, 0, xfer) -#endif MMRESULT OpenKernelSoundDeviceByName( @@ -671,182 +661,4 @@ OUT LPDWORD BytesTransferred OPTIONAL); -#if 0 - -typedef UCHAR MMDEVICE_TYPE, *PMMDEVICE_TYPE; - -struct _SOUND_DEVICE; -struct _SOUND_DEVICE_INSTANCE; - - -/* - Rather than pass caps structures around as a PVOID, this can be - used instead. -*/ - -typedef union _UNIVERSAL_CAPS -{ - WAVEOUTCAPS WaveOut; - WAVEINCAPS WaveIn; - MIDIOUTCAPS MidiOut; - MIDIINCAPS MidiIn; -} UNIVERSAL_CAPS, *PUNIVERSAL_CAPS; - - - -/* New sound thread code */ - -typedef MMRESULT (*SOUND_THREAD_REQUEST_HANDLER)( - IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, - IN OPTIONAL PVOID Parameter); - -typedef struct _SOUND_THREAD_REQUEST -{ - /* The sound device instance this request relates to */ - struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance; - /* What function to call */ - SOUND_THREAD_REQUEST_HANDLER RequestHandler; - /* Caller-defined parameter */ - PVOID Parameter; - /* This will contain the return code of the request function */ - MMRESULT ReturnValue; -} SOUND_THREAD_REQUEST, *PSOUND_THREAD_REQUEST; - -typedef VOID (*SOUND_THREAD_IO_COMPLETION_HANDLER)( - IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, - IN PVOID Parameter OPTIONAL, - IN DWORD BytesWritten); - -typedef struct _SOUND_THREAD_COMPLETED_IO -{ - struct _SOUND_THREAD_COMPLETED_IO* Previous; - struct _SOUND_THREAD_COMPLETED_IO* Next; - - struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance; - SOUND_THREAD_IO_COMPLETION_HANDLER CompletionHandler; - PVOID Parameter; - DWORD BytesTransferred; -} SOUND_THREAD_COMPLETED_IO, *PSOUND_THREAD_COMPLETED_IO; - -typedef struct _SOUND_THREAD_OVERLAPPED -{ - OVERLAPPED General; - - /* Pointer to structure to fill with completion data */ - PSOUND_THREAD_COMPLETED_IO CompletionData; -} SOUND_THREAD_OVERLAPPED, *PSOUND_THREAD_OVERLAPPED; - -/* - Audio device function table -*/ - -typedef MMRESULT (*MMCREATEINSTANCE_FUNC)( - IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance); - -typedef VOID (*MMDESTROYINSTANCE_FUNC)( - IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance); - -typedef MMRESULT (*MMGETCAPS_FUNC)( - IN struct _SOUND_DEVICE* Device, - OUT PUNIVERSAL_CAPS Capabilities); - -typedef MMRESULT (*MMWAVEQUERYFORMAT_FUNC)( - IN struct _SOUND_DEVICE* Device, - IN PWAVEFORMATEX WaveFormat, - IN DWORD WaveFormatSize); - -typedef MMRESULT (*MMWAVESETFORMAT_FUNC)( - IN struct _SOUND_DEVICE_INSTANCE* Instance, - IN PWAVEFORMATEX WaveFormat, - IN DWORD WaveFormatSize); - -typedef MMRESULT (*MMWAVEQUEUEBUFFER_FUNC)( - IN struct _SOUND_DEVICE_INSTANCE* Instance, - IN PWAVEHDR WaveHeader); - -typedef MMRESULT (*MMGETWAVESTATE_FUNC)( - IN struct _SOUND_DEVICE_INSTANCE* Instance, - OUT PULONG State); - -typedef MMRESULT (*MMSETWAVESTATE_FUNC)( - IN struct _SOUND_DEVICE_INSTANCE* Instance); - -typedef struct _MMFUNCTION_TABLE -{ - MMCREATEINSTANCE_FUNC Constructor; - MMDESTROYINSTANCE_FUNC Destructor; - MMGETCAPS_FUNC GetCapabilities; - - MMWAVEQUERYFORMAT_FUNC QueryWaveFormat; - MMWAVESETFORMAT_FUNC SetWaveFormat; - MMWAVEQUEUEBUFFER_FUNC QueueWaveBuffer; - - MMGETWAVESTATE_FUNC GetWaveDeviceState; - MMSETWAVESTATE_FUNC PauseWaveDevice; - MMSETWAVESTATE_FUNC RestartWaveDevice; - MMSETWAVESTATE_FUNC ResetWaveDevice; - MMSETWAVESTATE_FUNC BreakWaveDeviceLoop; -} MMFUNCTION_TABLE, *PMMFUNCTION_TABLE; - - -/* - Represents an audio device -*/ - -#define SOUND_DEVICE_TAG "SndD" - -typedef struct _SOUND_DEVICE -{ - struct _SOUND_DEVICE* Next; - struct _SOUND_DEVICE_INSTANCE* FirstInstance; - UCHAR DeviceType; - LPWSTR DevicePath; - MMFUNCTION_TABLE Functions; -} SOUND_DEVICE, *PSOUND_DEVICE; - - -/* - Represents an individual instance of an audio device -*/ - -#define WAVE_STREAM_INFO_TAG "WavS" - -typedef struct _WAVE_STREAM_INFO -{ - /* Buffer queue head and tail */ - PWAVEHDR BufferQueueHead; - PWAVEHDR BufferQueueTail; - /* The buffer currently being processed */ - PWAVEHDR CurrentBuffer; - /* How far into the current buffer we've gone */ - DWORD BufferOffset; - /* How many I/O operations have been submitted */ - DWORD BuffersOutstanding; - /* Looping */ - PWAVEHDR LoopHead; - DWORD LoopsRemaining; -} WAVE_STREAM_INFO, *PWAVE_STREAM_INFO; - - -#define SOUND_DEVICE_INSTANCE_TAG "SndI" - -typedef struct _SOUND_DEVICE_INSTANCE -{ - struct _SOUND_DEVICE_INSTANCE* Next; - PSOUND_DEVICE Device; - - /* The currently opened handle to the device */ - HANDLE Handle; -/* PSOUND_THREAD Thread;*/ - - - /* Device-specific parameters */ - union - { - WAVE_STREAM_INFO Wave; - } Streaming; -} SOUND_DEVICE_INSTANCE, *PSOUND_DEVICE_INSTANCE; - #endif - -#endif Modified: trunk/reactos/lib/drivers/sound/mmebuddy/deviceinstance.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/deviceinstance.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/deviceinstance.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -37,8 +37,12 @@ FreeSoundDeviceInstance( IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance) { - /* This won't work as the device is no longer valid by this point! */ - /*SND_ASSERT( IsValidSoundDeviceInstance(SoundDeviceInstance) );*/ + /* + Device is marked as invalid by now, but we can still do some sanity + checking. + */ + SND_ASSERT( SoundDeviceInstance->Thread == NULL ); + ZeroMemory(SoundDeviceInstance, sizeof(SOUND_DEVICE_INSTANCE)); FreeMemory(SoundDeviceInstance); } @@ -190,9 +194,9 @@ (*SoundDeviceInstance)->HeadWaveHeader = NULL; (*SoundDeviceInstance)->TailWaveHeader = NULL; - (*SoundDeviceInstance)->CurrentWaveHeader = NULL; (*SoundDeviceInstance)->OutstandingBuffers = 0; - // TODO: Loop + + (*SoundDeviceInstance)->LoopsRemaining = 0; /* Create the streaming thread (TODO - is this for wave only?) */ Result = CreateSoundThread(&(*SoundDeviceInstance)->Thread); @@ -255,13 +259,26 @@ return MMSYSERR_NOTSUPPORTED; } + /* Stop the streaming thread (TODO - is this for wave only?) */ + Result = DestroySoundThread(SoundDeviceInstance->Thread); + SND_ASSERT( MMSUCCESS(Result) ); /* It should succeed! */ + if ( ! MMSUCCESS(Result ) ) + { + return TranslateInternalMmResult(Result); + } + + /* Blank this out here */ + SoundDeviceInstance->Thread = NULL; + /* Try and close the device */ Result = FunctionTable->Close(SoundDeviceInstance, Handle); + SND_ASSERT( MMSUCCESS(Result) ); /* It should succeed! */ if ( ! MMSUCCESS(Result) ) return TranslateInternalMmResult(Result); /* Drop it from the list */ Result = UnlistSoundDeviceInstance(SoundDeviceInstance); + SND_ASSERT( MMSUCCESS(Result) ); /* It should succeed! */ if ( ! MMSUCCESS(Result) ) return TranslateInternalMmResult(Result); @@ -274,7 +291,19 @@ DestroyAllSoundDeviceInstances( IN PSOUND_DEVICE SoundDevice) { - return MMSYSERR_NOTSUPPORTED; + MMRESULT Result; + PSOUND_DEVICE_INSTANCE SoundDeviceInstance; + + SoundDeviceInstance = SoundDevice->HeadInstance; + + while ( SoundDeviceInstance ) + { + Result = DestroySoundDeviceInstance(SoundDeviceInstance); + SND_ASSERT( MMSUCCESS(Result) ); + SoundDeviceInstance = SoundDeviceInstance->Next; + } + + return MMSYSERR_NOERROR; } MMRESULT Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -51,6 +51,41 @@ Parameter2); break; } + + case MXDM_INIT : + { + break; + } + + case MXDM_OPEN : + { + break; + } + + case MXDM_CLOSE : + { + break; + } + + case MXDM_GETCONTROLDETAILS : + { + break; + } + + case MXDM_SETCONTROLDETAILS : + { + break; + } + + case MXDM_GETLINECONTROLS : + { + break; + } + + case MXDM_GETLINEINFO : + { + break; + } } SND_TRACE(L"mxdMessage returning MMRESULT %d\n", Result); Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -164,6 +164,9 @@ VALIDATE_MMSYS_PARAMETER( PrivateHandle ); SoundDeviceInstance = (PSOUND_DEVICE_INSTANCE) PrivateHandle; + if ( ! IsValidSoundDeviceInstance(SoundDeviceInstance) ) + return MMSYSERR_INVALHANDLE; + Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); if ( ! MMSUCCESS(Result) ) return TranslateInternalMmResult(Result); @@ -172,7 +175,11 @@ if ( ! MMSUCCESS(Result) ) return TranslateInternalMmResult(Result); + + /* TODO: Check device is stopped! */ + ReleaseEntrypointMutex(DeviceType); + /* TODO: Work with MIDI devices too */ NotifyMmeClient(SoundDeviceInstance, DeviceType == WAVE_OUT_DEVICE_TYPE ? WOM_CLOSE : WIM_CLOSE, 0); @@ -182,3 +189,17 @@ return Result; } + +MMRESULT +MmeResetWavePlayback( + IN DWORD PrivateHandle) +{ + PSOUND_DEVICE_INSTANCE SoundDeviceInstance; + + SND_TRACE(L"Resetting wave device (WODM_RESET)\n"); + + VALIDATE_MMSYS_PARAMETER( PrivateHandle ); + SoundDeviceInstance = (PSOUND_DEVICE_INSTANCE) PrivateHandle; + + return StopStreaming(SoundDeviceInstance); +} Added: trunk/reactos/lib/drivers/sound/mmebuddy/readme.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/readme.txt (added) +++ trunk/reactos/lib/drivers/sound/mmebuddy/readme.txt [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -1,0 +1,90 @@ +MME BUDDY + +This library currently is capable of maintaining lists of devices for all of +the MME types, it will provide the appropriate entrypoints for each device +type, and code using this library simply needs to inform the MME Buddy +library of the devices that exist, and provide callback routines to be used +when opening/closing/playing, etc. + +Code using this library needs to provide its own DriverProc entrypoint (this +may be refactored in future so that simply an init/cleanup routine need be +provided.) + + +WAVE OUTPUT +=========== +Supported MME messages: +* WODM_GETNUMDEVS (Get number of devices) +* WODM_GETDEVCAPS (Get device capabilities) +* WODM_OPEN (Open a device, query supported formats) +* WODM_CLOSE (Close a device) +* WODM_PREPARE (Prepare a wave header) +* WODM_UNPREPARE (Unprepare a wave header) +* WODM_WRITE (Submit a prepared header to be played) + +Unsupported MME messages: +* Any not mentioned above + +Notes/Bugs: +* WHDR_BEGINLOOP and WHDR_ENDLOOP are ignored +* Not possible to pause/restart playback + + +WAVE INPUT +========== +Supported MME messages: +* WIDM_GETNUMDEVS (Get number of devices) + +Unsupported MME messages: +* Any not mentioned above + +Notes/Bugs: +* Mostly unimplemented + + +MIDI OUTPUT +=========== +Supported MME messages: +* MODM_GETNUMDEVS (Get number of devices) + +Unsupported MME messages: +* Any not mentioned above + +Notes/Bugs: +* Mostly unimplemented + + +MIDI INPUT +========== +Supported MME messages: +* MIDM_GETNUMDEVS (Get number of devices) + +Unsupported MME messages: +* Any not mentioned above + +Notes/Bugs: +* Mostly unimplemented + + +AUXILIARY +========= +Supported MME messages: +* AUXM_GETNUMDEVS (Get number of devices) + +Unsupported MME messages: +* Any not mentioned above + +Notes/Bugs: +* Mostly unimplemented + + +MIXER +===== +Supported MME messages: +* MXDM_GETNUMDEVS (Get number of devices) + +Unsupported MME messages: +* Any not mentioned above + +Notes/Bugs: +* Mostly unimplemented Propchange: trunk/reactos/lib/drivers/sound/mmebuddy/readme.txt ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/lib/drivers/sound/mmebuddy/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/thread.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/thread.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -56,7 +56,7 @@ else if ( WaitResult == WAIT_IO_COMPLETION ) { SND_TRACE(L"SoundThread - Processing IO completion\n"); - /* TODO */ + /* TODO? What do we do here? Stream stuff? */ } else { @@ -66,8 +66,94 @@ } + SND_TRACE(L"Sound thread terminated\n"); + return 0; } + +MMRESULT +CallSoundThread( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, + IN SOUND_THREAD_REQUEST_HANDLER RequestHandler, + IN PVOID Parameter OPTIONAL) +{ + PSOUND_THREAD Thread; + + VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) ); + VALIDATE_MMSYS_PARAMETER( RequestHandler ); + + Thread = SoundDeviceInstance->Thread; + + SND_TRACE(L"Waiting for READY event\n"); + WaitForSingleObject(Thread->Events.Ready, INFINITE); + + Thread->Request.Result = MMSYSERR_NOTSUPPORTED; + Thread->Request.Handler = RequestHandler; + Thread->Request.SoundDeviceInstance = SoundDeviceInstance; + Thread->Request.Parameter = Parameter; + + /* Notify the thread it has work to do */ + SND_TRACE(L"Setting REQUEST event\n"); + SetEvent(Thread->Events.Request); + + /* Wait for the work to be done */ + SND_TRACE(L"Waiting for DONE event\n"); + WaitForSingleObject(Thread->Events.Done, INFINITE); + + return Thread->Request.Result; +} + + +MMRESULT +SoundThreadTerminator( + IN PSOUND_DEVICE_INSTANCE Instance, + IN PVOID Parameter) +{ + PSOUND_THREAD Thread = (PSOUND_THREAD) Parameter; + + SND_TRACE(L"Sound thread terminator routine called\n"); + SND_ASSERT( Thread ); + + Thread->Running = FALSE; + + return MMSYSERR_NOERROR; +} + +MMRESULT +TerminateSoundThread( + IN PSOUND_THREAD Thread) +{ + DWORD WaitResult; + + SND_ASSERT( Thread ); + + SND_TRACE(L"Waiting for READY event\n"); + WaitForSingleObject(Thread->Events.Ready, INFINITE); + + Thread->Request.Result = MMSYSERR_NOTSUPPORTED; + Thread->Request.Handler = SoundThreadTerminator; + Thread->Request.SoundDeviceInstance = NULL; + Thread->Request.Parameter = (PVOID) Thread; + + /* Notify the thread it has work to do */ + SND_TRACE(L"Setting REQUEST event\n"); + SetEvent(Thread->Events.Request); + + /* Wait for the work to be done */ + SND_TRACE(L"Waiting for DONE event\n"); + WaitForSingleObject(Thread->Events.Done, INFINITE); + + /* Wait for the thread to actually end */ + WaitResult = WaitForSingleObject(Thread->Handle, INFINITE); + SND_ASSERT( WaitResult == WAIT_OBJECT_0 ); + + /* Close the thread and invalidate the handle */ + CloseHandle(Thread->Handle); /* Is this needed? */ + Thread->Handle = INVALID_HANDLE_VALUE; + + return MMSYSERR_NOERROR; +} + MMRESULT CreateSoundThreadEvents( @@ -195,39 +281,28 @@ IN PSOUND_THREAD Thread) { VALIDATE_MMSYS_PARAMETER( Thread ); + SND_ASSERT( Thread->Handle != INVALID_HANDLE_VALUE ); + SND_TRACE(L"Terminating sound thread\n"); - Thread->Running = FALSE; - /* TODO: Implement me! Wait for thread to have finished? */ - return MMSYSERR_NOTSUPPORTED; -} - -MMRESULT -CallSoundThread( - IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, - IN SOUND_THREAD_REQUEST_HANDLER RequestHandler, - IN PVOID Parameter OPTIONAL) -{ - VALIDATE_MMSYS_PARAMETER( SoundDeviceInstance ); - VALIDATE_MMSYS_PARAMETER( RequestHandler ); - - /* TODO: Don't call this directly? */ - PSOUND_THREAD Thread = SoundDeviceInstance->Thread; - - SND_TRACE(L"Waiting for READY event\n"); - WaitForSingleObject(Thread->Events.Ready, INFINITE); - - Thread->Request.Result = MMSYSERR_NOTSUPPORTED; - Thread->Request.Handler = RequestHandler; - Thread->Request.SoundDeviceInstance = SoundDeviceInstance; - Thread->Request.Parameter = Parameter; - - /* Notify the thread it has work to do */ - SND_TRACE(L"Setting REQUEST event\n"); - SetEvent(Thread->Events.Request); - - /* Wait for the work to be done */ - SND_TRACE(L"Waiting for DONE event\n"); - WaitForSingleObject(Thread->Events.Done, INFINITE); - - return Thread->Request.Result; -} + + /* Tell the thread to terminate itself */ + TerminateSoundThread(Thread); + + SND_TRACE(L"Sound thread terminated, performing cleanup of thread resources\n"); + + CloseHandle(Thread->Handle); /* Is this needed? */ + Thread->Handle = INVALID_HANDLE_VALUE; + + DestroySoundThreadEvents(Thread->Events.Ready, + Thread->Events.Request, + Thread->Events.Done); + + /* Wipe and free the memory used for the thread */ + ZeroMemory(Thread, sizeof(SOUND_THREAD)); + FreeMemory(Thread); + + SND_TRACE(L"Finished thread cleanup\n"); + + return MMSYSERR_NOERROR; +} + Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/wave/header.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/header.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -235,7 +235,7 @@ /* Set the "in queue" flag */ WaveHeader->dwFlags |= WHDR_INQUEUE; - if ( ! SoundDeviceInstance->TailWaveHeader ) + if ( ! SoundDeviceInstance->HeadWaveHeader ) { /* This is the first header in the queue */ SND_TRACE(L"Enqueued first wave header\n"); @@ -327,10 +327,12 @@ } /* Make sure we're not using this as the current buffer any more, either! */ +/* if ( SoundDeviceInstance->CurrentWaveHeader == Header ) { SoundDeviceInstance->CurrentWaveHeader = Header->lpNext; } +*/ DUMP_WAVEHDR_QUEUE(SoundDeviceInstance); Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -34,6 +34,7 @@ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance) { MMRESULT Result; + MMDEVICE_TYPE DeviceType; PSOUND_DEVICE SoundDevice; PMMFUNCTION_TABLE FunctionTable; PWAVEHDR Header; @@ -42,6 +43,9 @@ Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); SND_ASSERT( MMSUCCESS(Result) ); + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( MMSUCCESS(Result) ); + Result = GetSoundDeviceFunctionTable(SoundDevice, &FunctionTable); SND_ASSERT( MMSUCCESS(Result) ); SND_ASSERT( FunctionTable ); @@ -72,9 +76,13 @@ /* Can never be *above* the length */ SND_ASSERT( HeaderExtension->BytesCommitted <= Header->dwBufferLength ); + /* Is this header entirely committed? */ if ( HeaderExtension->BytesCommitted == Header->dwBufferLength ) { - Header = Header->lpNext; + { + /* Move on to the next header */ + Header = Header->lpNext; + } } else { @@ -106,6 +114,10 @@ Overlap->SoundDeviceInstance = SoundDeviceInstance; Overlap->Header = Header; + /* Don't complete this header if it's part of a loop */ + Overlap->PerformCompletion = TRUE; +// ( SoundDeviceInstance->LoopsRemaining > 0 ); + /* Adjust the commit-related counters */ HeaderExtension->BytesCommitted += BytesToCommit; ++ SoundDeviceInstance->OutstandingBuffers; @@ -128,34 +140,6 @@ } } } - - -#if 0 - - // HACK - SND_TRACE(L"Calling buffer submit routine\n"); - - if ( ! SoundDeviceInstance->CurrentWaveHeader ) - { - /* Start from the beginning (always a good idea) */ - SoundDeviceInstance->CurrentWaveHeader = SoundDeviceInstance->HeadWaveHeader; - } - - if ( SoundDeviceInstance->CurrentWaveHeader ) - { - /* Stream or continue streaming this header */ - - Result = CommitWaveHeaderToKernelDevice(SoundDeviceInstance, - SoundDeviceInstance->CurrentWaveHeader, - FunctionTable->CommitWaveBuffer); - } - else - { - SND_TRACE(L"NOTHING TO DO - REC/PLAY STOPPED\n"); - } - - return Result; -#endif } @@ -183,10 +167,13 @@ IN DWORD dwNumberOfBytesTransferred, IN LPOVERLAPPED lpOverlapped) { + MMDEVICE_TYPE DeviceType; + PSOUND_DEVICE SoundDevice; PSOUND_DEVICE_INSTANCE SoundDeviceInstance; PSOUND_OVERLAPPED SoundOverlapped = (PSOUND_OVERLAPPED) lpOverlapped; PWAVEHDR WaveHdr; PWAVEHDR_EXTENSION HdrExtension; + MMRESULT Result; WaveHdr = (PWAVEHDR) SoundOverlapped->Header; SND_ASSERT( WaveHdr ); @@ -196,13 +183,21 @@ SoundDeviceInstance = SoundOverlapped->SoundDeviceInstance; + Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); + SND_ASSERT( MMSUCCESS(Result) ); + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( MMSUCCESS(Result) ); + HdrExtension->BytesCompleted += dwNumberOfBytesTransferred; SND_TRACE(L"%d/%d bytes of wavehdr completed\n", HdrExtension->BytesCompleted, WaveHdr->dwBufferLength); /* We have an available buffer now */ -- SoundDeviceInstance->OutstandingBuffers; - if ( HdrExtension->BytesCompleted == WaveHdr->dwBufferLength ) + /* Did we finish a WAVEHDR and aren't looping? */ + if ( HdrExtension->BytesCompleted == WaveHdr->dwBufferLength && + SoundOverlapped->PerformCompletion ) { CompleteWaveHeader(SoundDeviceInstance, WaveHdr); } @@ -212,83 +207,6 @@ //CompleteWavePortion(SoundDeviceInstance, dwNumberOfBytesTransferred); FreeMemory(lpOverlapped); -} - -MMRESULT -CommitWaveHeaderToKernelDevice( - IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, - IN PWAVEHDR Header, - IN WAVE_COMMIT_FUNC CommitFunction) -{ - PSOUND_OVERLAPPED Overlap; - DWORD BytesToWrite, BytesRemaining; - PWAVEHDR_EXTENSION HdrExtension; - LPVOID Offset; - - VALIDATE_MMSYS_PARAMETER( SoundDeviceInstance ); - VALIDATE_MMSYS_PARAMETER( Header ); - VALIDATE_MMSYS_PARAMETER( CommitFunction ); - - HdrExtension = (PWAVEHDR_EXTENSION) Header->reserved; - VALIDATE_MMSYS_PARAMETER( HdrExtension ); - - /* Loop whilst there is data and sufficient available buffers */ - while ( ( SoundDeviceInstance->OutstandingBuffers < SOUND_KERNEL_BUFFER_COUNT ) && - ( HdrExtension->BytesCommitted < Header->dwBufferLength ) ) - { - /* Is this the start of a loop? */ - SoundDeviceInstance->WaveLoopStart = Header; - - /* Where to start pulling the data from within the buffer */ - Offset = Header->lpData + HdrExtension->BytesCommitted; - - /* How much of this header is not committed? */ - BytesRemaining = Header->dwBufferLength - HdrExtension->BytesCommitted; - - /* We can write anything up to the buffer size limit */ - BytesToWrite = BytesRemaining > SOUND_KERNEL_BUFFER_SIZE ? - SOUND_KERNEL_BUFFER_SIZE : - BytesRemaining; - - /* If there's nothing left in the current header, move to the next */ - if ( BytesToWrite == 0 ) - { - Header = Header->lpNext; - HdrExtension = (PWAVEHDR_EXTENSION) Header->reserved; - SND_ASSERT( HdrExtension ); - SND_ASSERT( HdrExtension->BytesCommitted == 0 ); - SND_ASSERT( HdrExtension->BytesCompleted == 0 ); - continue; - } - - HdrExtension->BytesCommitted += BytesToWrite; - - /* We're using up a buffer so update this */ - ++ SoundDeviceInstance->OutstandingBuffers; - - SND_TRACE(L"COMMIT: Offset 0x%x amount %d remain %d totalcommit %d", - Offset, BytesToWrite, BytesRemaining, HdrExtension->BytesCommitted); - - /* We need a new overlapped info structure for each buffer */ - Overlap = AllocateStruct(SOUND_OVERLAPPED); - - if ( Overlap ) - { - ZeroMemory(Overlap, sizeof(SOUND_OVERLAPPED)); - Overlap->SoundDeviceInstance = SoundDeviceInstance; - Overlap->Header = Header; - - - if ( ! MMSUCCESS(CommitFunction(SoundDeviceInstance, Offset, BytesToWrite, Overlap, CompleteIO)) ) - { - /* Just pretend it played if we fail... Show must go on, etc. etc. */ - SND_WARN(L"FAILED\n"); - HdrExtension->BytesCompleted += BytesToWrite; - } - } - } - - return MMSYSERR_NOERROR; } MMRESULT @@ -315,3 +233,48 @@ return MMSYSERR_NOERROR; } + + +/* + Stream control functions + (External/internal thread pairs) + + TODO - Move elsewhere as these shouldn't be wave specific! +*/ + +MMRESULT +StopStreamingInSoundThread( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, + IN PVOID Parameter) +{ + /* TODO */ + return MMSYSERR_NOTSUPPORTED; +} + +MMRESULT +StopStreaming( + IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance) +{ + MMRESULT Result; + PSOUND_DEVICE SoundDevice; + MMDEVICE_TYPE DeviceType; + + if ( ! IsValidSoundDeviceInstance(SoundDeviceInstance) ) + return MMSYSERR_INVALHANDLE; + + Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); + if ( ! MMSUCCESS(Result) ) + return TranslateInternalMmResult(Result); + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + if ( ! MMSUCCESS(Result) ) + return TranslateInternalMmResult(Result); + + /* FIXME: What about wave input? */ + if ( DeviceType != WAVE_OUT_DEVICE_TYPE ) + return MMSYSERR_NOTSUPPORTED; + + return CallSoundThread(SoundDeviceInstance, + StopStreamingInSoundThread, + NULL); +} Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c [iso-8859-1] Mon Feb 23 00:14:54 2009 @@ -98,14 +98,21 @@ break; } + case WODM_RESET : + { + /* Stop playback, reset position to zero */ + Result = MmeResetWavePlayback(PrivateHandle); + break; + } + + case WODM_RESTART : + { + /* Continue playback when paused */ + break; + } + case WODM_GETPOS : { -#if 0 - /* Hacky code to test the threading */ - PSOUND_DEVICE_INSTANCE Instance = (PSOUND_DEVICE_INSTANCE)PrivateHandle; - CallSoundThread(Instance->Thread, HelloWorld, Instance, L"Hello World!"); - CallSoundThread(Instance->Thread, HelloWorld, Instance, L"Hello Universe!"); -#endif break; } }
15 years, 10 months
1
0
0
0
[janderwald] 39715: - Implement a common property handler for filter property requests - Always queue a work item for pin creation requests - Handle KSPROPERTY_PIN_DATAFLOW, KSPROPERTY_PIN_DATARANGES, KSPROPERTY_PIN_INTERFACES, KSPROPERTY_PIN_MEDIUMS, KSPROPERTY_PIN_COMMUNICATION, KSPROPERTY_PIN_CATEGORY, qKSPROPERTY_PIN_NAME, KSPROPERTY_PIN_GLOBALCINSTANCES, KSPROPERTY_PIN_CINSTANCES, KSPROPERTY_PIN_NECESSARYINSTANCES - Fix several bugs in property copying code - Change the pin creation path in
by janderwald@svn.reactos.org
Author: janderwald Date: Sun Feb 22 21:58:51 2009 New Revision: 39715 URL:
http://svn.reactos.org/svn/reactos?rev=39715&view=rev
Log: - Implement a common property handler for filter property requests - Always queue a work item for pin creation requests - Handle KSPROPERTY_PIN_DATAFLOW, KSPROPERTY_PIN_DATARANGES, KSPROPERTY_PIN_INTERFACES, KSPROPERTY_PIN_MEDIUMS, KSPROPERTY_PIN_COMMUNICATION, KSPROPERTY_PIN_CATEGORY, qKSPROPERTY_PIN_NAME, KSPROPERTY_PIN_GLOBALCINSTANCES, KSPROPERTY_PIN_CINSTANCES, KSPROPERTY_PIN_NECESSARYINSTANCES - Fix several bugs in property copying code - Change the pin creation path in sysaudio in order to have client information as this was previously not available (see DPRINT using hack) - Close file handels in wdmaud / sysaudio - set Iostatus before queing an irp as the irp might complete before accessing status io Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.c trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.c trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c trunk/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h trunk/reactos/drivers/wdm/audio/sysaudio/control.c trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c trunk/reactos/drivers/wdm/audio/sysaudio/pin.c trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -133,7 +133,7 @@ } /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI @@ -142,8 +142,23 @@ IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - - return STATUS_UNSUCCESSFUL; + PIO_STACK_LOCATION IoStack; + ISubdevice *SubDevice = NULL; + SUBDEVICE_DESCRIPTOR * Descriptor; + + IPortFilterWaveCyclicImpl * This = (IPortFilterWaveCyclicImpl *)iface; + + IoStack = IoGetCurrentIrpStackLocation(Irp); + ASSERT(IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_PROPERTY); + ASSERT(This->Port->lpVtbl->QueryInterface(This->Port, &IID_ISubdevice, (PVOID*)&SubDevice) == STATUS_SUCCESS); + ASSERT(SubDevice != NULL); + + ASSERT(SubDevice->lpVtbl->GetDescriptor(SubDevice, &Descriptor) == STATUS_SUCCESS); + ASSERT(Descriptor != NULL); + + SubDevice->lpVtbl->Release(SubDevice); + + return PcPropertyHandler(Irp, Descriptor); } /* Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.h [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -99,9 +99,20 @@ typedef struct { + ULONG MaxGlobalInstanceCount; + ULONG MaxFilterInstanceCount; + ULONG MinFilterInstanceCount; + ULONG CurrentFilterInstanceCount; + +}PIN_INSTANCE_INFO, *PPIN_INSTANCE_INFO; + + +typedef struct +{ ULONG PinDescriptorCount; ULONG PinDescriptorSize; KSPIN_DESCRIPTOR * KsPinDescriptor; + PIN_INSTANCE_INFO * Instances; }KSPIN_FACTORY; typedef struct Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -486,8 +486,10 @@ ISubdevice * SubDevice; PPCLASS_DEVICE_EXTENSION DeviceExt; SUBDEVICE_ENTRY * Entry; - IIrpTarget *Filter, *Pin; + IIrpTarget *Filter; PKSOBJECT_CREATE_ITEM CreateItem; + PPIN_WORKER_CONTEXT Context; + PIO_WORKITEM WorkItem; DPRINT1("PcCreateItemDispatch called DeviceObject %p\n", DeviceObject); @@ -567,7 +569,6 @@ } else { - KSOBJECT_CREATE Create; LPWSTR Buffer = IoStack->FileObject->FileName.Buffer; static LPWSTR KS_NAME_PIN = L"{146F1A80-4791-11D0-A5D6-28DB04C10000}"; @@ -576,51 +577,33 @@ if (!wcsncmp(KS_NAME_PIN, Buffer, wcslen(KS_NAME_PIN))) { /* try to create new pin */ - - if (KeGetCurrentIrql() >= APC_LEVEL) - { - PPIN_WORKER_CONTEXT Context = AllocateItem(NonPagedPool, sizeof(PIN_WORKER_CONTEXT), TAG_PORTCLASS); - if (!Context) - { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; - return STATUS_INSUFFICIENT_RESOURCES; - } - Context->Filter = Filter; - Context->Irp = Irp; - - PIO_WORKITEM WorkItem = IoAllocateWorkItem(DeviceObject); - if (!WorkItem) - { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; - return STATUS_INSUFFICIENT_RESOURCES; - } - - IoQueueWorkItem(WorkItem, CreatePinWorkerRoutine, DelayedWorkQueue, (PVOID)Context); - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_PENDING; - IoMarkIrpPending(Irp); - return STATUS_PENDING; - } - - Create.CreateItemsCount = 1; - Create.CreateItemsList = (PKSOBJECT_CREATE_ITEM)(IoStack->FileObject->FileName.Buffer + (wcslen(KS_NAME_PIN) + 1)); - - Status = Filter->lpVtbl->NewIrpTarget(Filter, - &Pin, - KS_NAME_PIN, - NULL, - NonPagedPool, - DeviceObject, - Irp, - &Create); - if (NT_SUCCESS(Status)) + Context = AllocateItem(NonPagedPool, sizeof(PIN_WORKER_CONTEXT), TAG_PORTCLASS); + if (!Context) { - /* create the dispatch object */ - Status = NewDispatchObject(Irp, Pin); - DPRINT1("Pin %p\n", Pin); + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INSUFFICIENT_RESOURCES; } + Context->Filter = Filter; + Context->Irp = Irp; + + WorkItem = IoAllocateWorkItem(DeviceObject); + if (!WorkItem) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; + FreeItem(Context, TAG_PORTCLASS); + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INSUFFICIENT_RESOURCES; + } + DPRINT1("Queueing IRP %p\n", Irp); + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_PENDING; + IoMarkIrpPending(Irp); + IoQueueWorkItem(WorkItem, CreatePinWorkerRoutine, DelayedWorkQueue, (PVOID)Context); + + return STATUS_PENDING; } } Irp->IoStatus.Information = 0; Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -220,5 +220,11 @@ IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); +NTSTATUS +NTAPI +PcPropertyHandler( + IN PIRP Irp, + IN PSUBDEVICE_DESCRIPTOR Descriptor); + #endif Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -1,4 +1,62 @@ #include "private.h" + +NTSTATUS +HandlePropertyInstances( + IN PIRP Irp, + IN PKSIDENTIFIER Request, + IN OUT PVOID Data, + IN PSUBDEVICE_DESCRIPTOR Descriptor, + IN BOOL Global) +{ + KSPIN_CINSTANCES * Instances; + KSP_PIN * Pin = (KSP_PIN*)Request; + + if (Pin->PinId >= Descriptor->Factory.PinDescriptorCount) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + return STATUS_INVALID_PARAMETER; + } + + Instances = (KSPIN_CINSTANCES*)Data; + + if (Global) + Instances->PossibleCount = Descriptor->Factory.Instances[Pin->PinId].MaxGlobalInstanceCount; + else + Instances->PossibleCount = Descriptor->Factory.Instances[Pin->PinId].MaxFilterInstanceCount; + + Instances->CurrentCount = Descriptor->Factory.Instances[Pin->PinId].CurrentFilterInstanceCount; + + Irp->IoStatus.Information = sizeof(KSPIN_CINSTANCES); + Irp->IoStatus.Status = STATUS_SUCCESS; + return STATUS_SUCCESS; +} + +NTSTATUS +HandleNecessaryPropertyInstances( + IN PIRP Irp, + IN PKSIDENTIFIER Request, + IN OUT PVOID Data, + IN PSUBDEVICE_DESCRIPTOR Descriptor) +{ + PULONG Result; + KSP_PIN * Pin = (KSP_PIN*)Request; + + if (Pin->PinId >= Descriptor->Factory.PinDescriptorCount) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + return STATUS_INVALID_PARAMETER; + } + + Result = (PULONG)Data; + *Result = Descriptor->Factory.Instances[Pin->PinId].MinFilterInstanceCount; + + Irp->IoStatus.Information = sizeof(ULONG); + Irp->IoStatus.Status = STATUS_SUCCESS; + return STATUS_SUCCESS; +} + NTSTATUS NTAPI @@ -7,7 +65,11 @@ IN PKSIDENTIFIER Request, IN OUT PVOID Data) { + PSUBDEVICE_DESCRIPTOR Descriptor; NTSTATUS Status = STATUS_UNSUCCESSFUL; + + Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp); + ASSERT(Descriptor); switch(Request->Id) { @@ -19,12 +81,19 @@ case KSPROPERTY_PIN_COMMUNICATION: case KSPROPERTY_PIN_CATEGORY: case KSPROPERTY_PIN_NAME: - // KsPinPropertyHandler - break; + Status = KsPinPropertyHandler(Irp, Request, Data, Descriptor->Factory.PinDescriptorCount, Descriptor->Factory.KsPinDescriptor); + break; + case KSPROPERTY_PIN_GLOBALCINSTANCES: + Status = HandlePropertyInstances(Irp, Request, Data, Descriptor, TRUE); + break; + case KSPROPERTY_PIN_CINSTANCES: + Status = HandlePropertyInstances(Irp, Request, Data, Descriptor, FALSE); + break; + case KSPROPERTY_PIN_NECESSARYINSTANCES: + Status = HandleNecessaryPropertyInstances(Irp, Request, Data, Descriptor); + break; + case KSPROPERTY_PIN_DATAINTERSECTION: - case KSPROPERTY_PIN_CINSTANCES: - case KSPROPERTY_PIN_GLOBALCINSTANCES: - case KSPROPERTY_PIN_NECESSARYINSTANCES: case KSPROPERTY_PIN_PHYSICALCONNECTION: case KSPROPERTY_PIN_CONSTRAINEDDATARANGES: DPRINT1("Unhandled %x\n", Request->Id); @@ -52,3 +121,85 @@ NULL /* FIXME */); } +NTSTATUS +NTAPI +PcPropertyHandler( + IN PIRP Irp, + IN PSUBDEVICE_DESCRIPTOR Descriptor) +{ + ULONG Index, ItemIndex; + PIO_STACK_LOCATION IoStack; + PKSPROPERTY Property; + PFNKSHANDLER PropertyHandler = NULL; + UNICODE_STRING GuidString; + NTSTATUS Status = STATUS_UNSUCCESSFUL; + + IoStack = IoGetCurrentIrpStackLocation(Irp); + + Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer; + ASSERT(Property); + + DPRINT1("Num of Property Sets %u\n", Descriptor->FilterPropertySet.FreeKsPropertySetOffset); + for(Index = 0; Index < Descriptor->FilterPropertySet.FreeKsPropertySetOffset; Index++) + { + RtlStringFromGUID ((GUID*)Descriptor->FilterPropertySet.Properties[Index].Set, &GuidString); + DPRINT1("Current GUID %S\n", GuidString.Buffer); + RtlFreeUnicodeString(&GuidString); + + if (IsEqualGUIDAligned(&Property->Set, Descriptor->FilterPropertySet.Properties[Index].Set)) + { + DPRINT1("Found Property Set Properties %u\n", Descriptor->FilterPropertySet.Properties[Index].PropertiesCount); + for(ItemIndex = 0; ItemIndex < Descriptor->FilterPropertySet.Properties[Index].PropertiesCount; ItemIndex++) + { + if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].PropertyId == Property->Id) + { + DPRINT1("Found property set identifier %u\n", Property->Id); + if (Property->Flags & KSPROPERTY_TYPE_SET) + PropertyHandler = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].SetPropertyHandler; + + if (Property->Flags & KSPROPERTY_TYPE_GET) + PropertyHandler = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].GetPropertyHandler; + + if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinProperty > IoStack->Parameters.DeviceIoControl.InputBufferLength) + { + /* too small input buffer */ + Irp->IoStatus.Information = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinProperty; + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + return STATUS_BUFFER_TOO_SMALL; + } + + if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinData > IoStack->Parameters.DeviceIoControl.OutputBufferLength) + { + /* too small output buffer */ + Irp->IoStatus.Information = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinData; + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + return STATUS_BUFFER_TOO_SMALL; + } + + if (PropertyHandler) + { + KSPROPERTY_ITEM_IRP_STORAGE(Irp) = (PVOID)Descriptor; + DPRINT1("Calling property handler %p\n", PropertyHandler); + Status = PropertyHandler(Irp, Property, Irp->UserBuffer); + } + + /* the information member is set by the handler */ + Irp->IoStatus.Status = Status; + DPRINT1("Result %x\n", Status); + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } + } + } + } + + RtlStringFromGUID(&Property->Set, &GuidString); + DPRINT1("Unhandeled property: Set %S Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags); + DbgBreakPoint(); + RtlFreeUnicodeString(&GuidString); + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -108,7 +108,17 @@ RtlMoveMemory((PVOID)Descriptor->FilterPropertySet.Properties[Descriptor->FilterPropertySet.FreeKsPropertySetOffset].PropertyItem, FilterProperty->PropertyItem, sizeof(KSPROPERTY_ITEM) * FilterProperty->PropertiesCount); - } + + } + Descriptor->FilterPropertySet.Properties[Descriptor->FilterPropertySet.FreeKsPropertySetOffset].Set = AllocateItem(NonPagedPool, sizeof(GUID), TAG_PORTCLASS); + if (!Descriptor->FilterPropertySet.Properties[Descriptor->FilterPropertySet.FreeKsPropertySetOffset].Set) + return STATUS_INSUFFICIENT_RESOURCES; + + RtlCopyMemory((PVOID)Descriptor->FilterPropertySet.Properties[Descriptor->FilterPropertySet.FreeKsPropertySetOffset].Set, FilterProperty->Set, sizeof(GUID)); + + /* ignore fast io table for now */ + Descriptor->FilterPropertySet.Properties[Descriptor->FilterPropertySet.FreeKsPropertySetOffset].FastIoCount = 0; + Descriptor->FilterPropertySet.Properties[Descriptor->FilterPropertySet.FreeKsPropertySetOffset].FastIoTable = NULL; Descriptor->FilterPropertySet.FreeKsPropertySetOffset++; @@ -177,12 +187,22 @@ if (!Descriptor->Factory.KsPinDescriptor) goto cleanup; + Descriptor->Factory.Instances = AllocateItem(NonPagedPool, FilterDescription->PinCount * sizeof(PIN_INSTANCE_INFO), TAG_PORTCLASS); + if (!Descriptor->Factory.Instances) + goto cleanup; + Descriptor->Factory.PinDescriptorCount = FilterDescription->PinCount; Descriptor->Factory.PinDescriptorSize = FilterDescription->PinSize; /* copy pin factories */ for(Index = 0; Index < FilterDescription->PinCount; Index++) + { RtlMoveMemory(&Descriptor->Factory.KsPinDescriptor[Index], &FilterDescription->Pins[Index].KsPinDescriptor, FilterDescription->PinSize); + Descriptor->Factory.Instances[Index].CurrentFilterInstanceCount = 0; + Descriptor->Factory.Instances[Index].MaxFilterInstanceCount = FilterDescription->Pins[Index].MaxFilterInstanceCount; + Descriptor->Factory.Instances[Index].MaxGlobalInstanceCount = FilterDescription->Pins[Index].MaxGlobalInstanceCount; + Descriptor->Factory.Instances[Index].MinFilterInstanceCount = FilterDescription->Pins[Index].MinFilterInstanceCount; + } } *OutSubdeviceDescriptor = Descriptor; Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -44,6 +44,7 @@ ACCESS_MASK DesiredAccess = 0; HANDLE PinHandle; KSPIN_CONNECT * PinConnect; + ULONG Length; KSDATAFORMAT_WAVEFORMATEX * DataFormat; if (DeviceInfo->DeviceType != WAVE_OUT_DEVICE_TYPE) @@ -52,7 +53,8 @@ return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); } - InstanceInfo = ExAllocatePool(NonPagedPool, sizeof(KSDATAFORMAT_WAVEFORMATEX) + sizeof(KSPIN_CONNECT)); + Length = sizeof(KSDATAFORMAT_WAVEFORMATEX) + sizeof(KSPIN_CONNECT) + sizeof(SYSAUDIO_INSTANCE_INFO); + InstanceInfo = ExAllocatePool(NonPagedPool, Length); if (!InstanceInfo) { /* no memory */ @@ -90,7 +92,7 @@ DesiredAccess |= GENERIC_WRITE; } - PinConnect = (KSPIN_CONNECT*)InstanceInfo; + PinConnect = (KSPIN_CONNECT*)(InstanceInfo + 1); PinConnect->Interface.Set = KSINTERFACESETID_Standard; @@ -100,7 +102,7 @@ PinConnect->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE; PinConnect->Medium.Flags = 0; PinConnect->PinId = 0; //FIXME - PinConnect->PinToHandle = NULL; + PinConnect->PinToHandle = ClientInfo->hSysAudio; PinConnect->Priority.PriorityClass = KSPRIORITY_NORMAL; PinConnect->Priority.PrioritySubClass = 1; @@ -125,16 +127,25 @@ DataFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX; DataFormat->DataFormat.SampleSize = 4; - - Status = KsCreatePin(ClientInfo->hSysAudio, PinConnect, DesiredAccess, &PinHandle); - DPRINT1("KsCreatePin Status %x\n", Status); - - - /* free buffer */ - ExFreePool(InstanceInfo); - + /* ros specific pin creation request */ + InstanceInfo->Property.Id = (ULONG)-1; + Status = KsSynchronousIoControlDevice(ClientInfo->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)InstanceInfo, Length, &PinHandle, sizeof(HANDLE), &BytesReturned); if (NT_SUCCESS(Status)) { + PHANDLE Handels = ExAllocatePool(NonPagedPool, sizeof(HANDLE) * (ClientInfo->NumPins+1)); + + if (Handels) + { + if (ClientInfo->NumPins) + { + RtlMoveMemory(Handels, ClientInfo->hPins, sizeof(HANDLE) * ClientInfo->NumPins); + ExFreePool(ClientInfo->hPins); + } + + ClientInfo->hPins = Handels; + ClientInfo->hPins[ClientInfo->NumPins] = PinHandle; + ClientInfo->NumPins++; + } DeviceInfo->hDevice = PinHandle; } else @@ -338,7 +349,6 @@ IoStack = IoGetCurrentIrpStackLocation(Irp); DPRINT1("WdmAudDeviceControl entered\n"); - DbgBreakPoint(); if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(WDMAUD_DEVICE_INFO)) { Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -167,53 +167,64 @@ { NTSTATUS Status = STATUS_SUCCESS; PWDMAUD_DEVICE_EXTENSION DeviceExtension; + + DPRINT1("WdmAudClose\n"); + + DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + +#if KS_IMPLEMENTED + Status = KsDereferenceSoftwareBusObject(DeviceExtension->DeviceHeader); + + if (NT_SUCCESS(Status)) + { + if (DeviceExtension->SysAudioNotification) + Status = IoUnregisterPlugPlayNotification(DeviceExtension->SysAudioNotification); + } +#endif + + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; +} + +NTSTATUS +NTAPI +WdmAudCleanup( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ PIO_STACK_LOCATION IoStack; WDMAUD_CLIENT *pClient; - - DPRINT1("WdmAudClose\n"); - - DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - -#if KS_IMPLEMENTED - Status = KsDereferenceSoftwareBusObject(DeviceExtension->DeviceHeader); - - if (NT_SUCCESS(Status)) - { - if (DeviceExtension->SysAudioNotification) - Status = IoUnregisterPlugPlayNotification(DeviceExtension->SysAudioNotification); - } -#endif + ULONG Index; + + DPRINT1("WdmAudCleanup\n"); IoStack = IoGetCurrentIrpStackLocation(Irp); pClient = (WDMAUD_CLIENT*)IoStack->FileObject->FsContext; + if (pClient) { + for (Index = 0; Index < pClient->NumPins; Index++) + ZwClose(pClient->hPins[Index]); + + if (pClient->hPins) + { + ExFreePool(pClient->hPins); + } + ObDereferenceObject(pClient->FileObject); ZwClose(pClient->hSysAudio); ExFreePool(pClient); IoStack->FileObject->FsContext = NULL; } - Irp->IoStatus.Status = Status; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return Status; -} - -NTSTATUS -NTAPI -WdmAudCleanup( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -{ - UNIMPLEMENTED - Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); - + DPRINT1("WdmAudCleanup complete\n"); return STATUS_SUCCESS; } Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -65,6 +65,8 @@ HANDLE hProcess; HANDLE hSysAudio; PFILE_OBJECT FileObject; + ULONG NumPins; + HANDLE * hPins; }WDMAUD_CLIENT, *PWDMAUD_CLIENT; Modified: trunk/reactos/drivers/wdm/audio/sysaudio/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -19,6 +19,8 @@ const GUID KSPROPSETID_Sysaudio = {0xCBE3FAA0L, 0xCC75, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}}; const GUID KSPROPSETID_Sysaudio_Pin = {0xA3A53220L, 0xC6E4, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}}; const GUID KSPROPSETID_General = {0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A, 0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}; +const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}; +const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}; NTSTATUS @@ -57,6 +59,7 @@ PSYSAUDIODEVEXT DeviceExtension) { PULONG Index; + PHANDLE Handle; ULONG Count; PSYSAUDIO_CLIENT ClientInfo; PKSAUDIO_DEVICE_ENTRY Entry; @@ -88,8 +91,17 @@ /* no memory */ return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); } + + ClientInfo->Handels = ExAllocatePool(NonPagedPool, sizeof(HANDLE)); + if (!ClientInfo->Devices) + { + /* no memory */ + return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); + } + ClientInfo->NumDevices = 1; ClientInfo->Devices[0] = DeviceNumber; + ClientInfo->Handels[0] = NULL; /* increase usage count */ Entry->NumberOfClients++; return SetIrpIoStatus(Irp, STATUS_SUCCESS, 0); @@ -111,18 +123,157 @@ /* no memory */ return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); } + + Handle = ExAllocatePool(NonPagedPool, sizeof(HANDLE) * (ClientInfo->NumDevices + 1)); + if (!Handle) + { + /* no memory */ + ExFreePool(Index); + return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); + } + /* increase usage count */ Entry->NumberOfClients++; /* copy device count array */ - RtlMoveMemory(Index, ClientInfo->Devices, ClientInfo->NumDevices * sizeof(ULONG)); + if (ClientInfo->NumDevices) + { + RtlMoveMemory(Index, ClientInfo->Devices, ClientInfo->NumDevices * sizeof(ULONG)); + RtlMoveMemory(Handle, ClientInfo->Handels, ClientInfo->NumDevices * sizeof(HANDLE)); + } + Index[ClientInfo->NumDevices] = DeviceNumber; + Handle[ClientInfo->NumDevices] = NULL; + ExFreePool(ClientInfo->Handels); ExFreePool(ClientInfo->Devices); ClientInfo->NumDevices++; ClientInfo->Devices = Index; + ClientInfo->Handels = Handle; return SetIrpIoStatus(Irp, STATUS_SUCCESS, 0); - +} + +VOID +NTAPI +CreatePinWorkerRoutine( + IN PDEVICE_OBJECT DeviceObject, + IN PVOID Context) +{ + NTSTATUS Status; + HANDLE PinHandle; + HANDLE Filter; + PFILE_OBJECT FileObject; + PPIN_WORKER_CONTEXT WorkerContext = (PPIN_WORKER_CONTEXT)Context; + Filter = WorkerContext->PinConnect->PinToHandle; + + WorkerContext->PinConnect->PinToHandle = NULL; + + + if (WorkerContext->CreateRealPin) + { + /* create the real pin */ + Status = KsCreatePin(WorkerContext->Entry->Handle, WorkerContext->PinConnect, GENERIC_READ | GENERIC_WRITE, &PinHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create Pin with %x\n", Status); + SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0); + ExFreePool(WorkerContext); + return; + } + + /* get pin file object */ + Status = ObReferenceObjectByHandle(PinHandle, + GENERIC_READ | GENERIC_WRITE, + IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + + WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].PinHandle = PinHandle; + WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].References = 1; + WorkerContext->DispatchContext->Handle = PinHandle; + WorkerContext->DispatchContext->PinId = WorkerContext->PinConnect->PinId; + WorkerContext->DispatchContext->AudioEntry = WorkerContext->Entry; + + if (NT_SUCCESS(Status)) + WorkerContext->DispatchContext->FileObject = FileObject; + else + WorkerContext->DispatchContext->FileObject = NULL; + } + else + { + WorkerContext->DispatchContext->AudioEntry = WorkerContext->Entry; + WorkerContext->DispatchContext->Handle = WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].PinHandle; + WorkerContext->DispatchContext->PinId = WorkerContext->PinConnect->PinId; + + /* get pin file object */ + Status = ObReferenceObjectByHandle(PinHandle, + GENERIC_READ | GENERIC_WRITE, + IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to get file object with %x\n", Status); + SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0); + ExFreePool(WorkerContext); + return; + } + WorkerContext->DispatchContext->FileObject = FileObject; + } + + DPRINT1("creating virtual pin\n"); + /* now create the virtual audio pin which is exposed to wdmaud */ + Status = KsCreatePin(Filter, WorkerContext->PinConnect, GENERIC_READ | GENERIC_WRITE, &PinHandle); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create virtual pin with %x\n", Status); + if (WorkerContext->CreateRealPin) + { + /* mark pin as free to use */ + WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].References = 0; + } + + SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0); + ExFreePool(WorkerContext); + return; + } + + /* get pin file object */ + Status = ObReferenceObjectByHandle(PinHandle, + GENERIC_READ | GENERIC_WRITE, + IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to get file object with %x\n", Status); + if (WorkerContext->CreateRealPin) + { + /* mark pin as free to use */ + WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].References = 0; + } + + ZwClose(PinHandle); + SetIrpIoStatus(WorkerContext->Irp, STATUS_UNSUCCESSFUL, 0); + ExFreePool(WorkerContext); + return; + } + + ASSERT(WorkerContext->DispatchContext); + ASSERT(WorkerContext->DispatchContext->AudioEntry != NULL); + ASSERT(WorkerContext->DispatchContext->FileObject != NULL); + ASSERT(WorkerContext->DispatchContext->Handle != NULL); + ASSERT(WorkerContext->AudioClient); + ASSERT(WorkerContext->AudioClient->Handels); + ASSERT(WorkerContext->AudioClient->Handels[WorkerContext->AudioClient->NumDevices -1] == NULL); + + /* store pin context */ + FileObject->FsContext2 = (PVOID)WorkerContext->DispatchContext; + + /* store pin handle in client specific struct */ + WorkerContext->AudioClient->Handels[WorkerContext->AudioClient->NumDevices-1] = PinHandle; + + DPRINT1("Successfully created Pin %p\n", WorkerContext->Irp); + *((PHANDLE)WorkerContext->Irp->UserBuffer) = PinHandle; + + SetIrpIoStatus(WorkerContext->Irp, STATUS_SUCCESS, sizeof(HANDLE)); } @@ -144,6 +295,14 @@ ULONG Count, BytesReturned; PKSOBJECT_CREATE_ITEM CreateItem; UNICODE_STRING GuidString; + ULONG Length; + KSPIN_CONNECT * PinConnect; + KSP_PIN PinRequest; + KSPIN_CINSTANCES PinInstances; + PPIN_WORKER_CONTEXT WorkerContext; + PDISPATCH_CONTEXT DispatchContext; + PIO_WORKITEM WorkItem; + PFILE_OBJECT FileObject; /* access the create item */ CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp); @@ -279,6 +438,194 @@ return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); } } + else if (Property->Id == (ULONG)-1) + { + /* ros specific pin creation request */ + DPRINT1("Initiating create request\n"); + + Length = sizeof(KSDATAFORMAT) + sizeof(KSPIN_CONNECT) + sizeof(SYSAUDIO_INSTANCE_INFO); + if (IoStack->Parameters.DeviceIoControl.InputBufferLength < Length || + IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(HANDLE)) + { + /* invalid parameters */ + return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); + } + + /* get input parameter */ + InstanceInfo = (PSYSAUDIO_INSTANCE_INFO)Property; + if (DeviceExtension->NumberOfKsAudioDevices <= InstanceInfo->DeviceNumber) + { + /* invalid parameters */ + return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); + } + + /* get client context */ + ClientInfo = (PSYSAUDIO_CLIENT)CreateItem->Context; + ASSERT(ClientInfo); + ASSERT(ClientInfo->NumDevices >= 1); + ASSERT(ClientInfo->Devices != NULL); + ASSERT(ClientInfo->Devices[ClientInfo->NumDevices-1] == InstanceInfo->DeviceNumber); + + /* get sysaudio entry */ + Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, InstanceInfo->DeviceNumber); + ASSERT(Entry != NULL); + + if (!Entry->Pins) + { + PropertyRequest.Set = KSPROPSETID_Pin; + PropertyRequest.Flags = KSPROPERTY_TYPE_GET; + PropertyRequest.Id = KSPROPERTY_PIN_CTYPES; + + /* query for num of pins */ + Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PropertyRequest, sizeof(KSPROPERTY), (PVOID)&Count, sizeof(ULONG), &BytesReturned); + if (!NT_SUCCESS(Status)) + { + DPRINT("Property Request KSPROPERTY_PIN_CTYPES failed with %x\n", Status); + return SetIrpIoStatus(Irp, Status, 0); + } + DPRINT("KSPROPERTY_TYPE_GET num pins %d\n", Count); + + Entry->Pins = ExAllocatePool(NonPagedPool, Count * sizeof(PIN_INFO)); + if (!Entry->Pins) + { + /* invalid parameters */ + return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); + } + /* clear array */ + RtlZeroMemory(Entry->Pins, sizeof(PIN_INFO) * Count); + Entry->NumberOfPins = Count; + + } + + /* get connect details */ + PinConnect = (KSPIN_CONNECT*)(InstanceInfo + 1); + + if (Entry->NumberOfPins <= PinConnect->PinId) + { + DPRINT("Invalid PinId %x\n", PinConnect->PinId); + return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); + } + + PinRequest.PinId = PinConnect->PinId; + PinRequest.Property.Set = KSPROPSETID_Pin; + PinRequest.Property.Flags = KSPROPERTY_TYPE_GET; + PinRequest.Property.Id = KSPROPERTY_PIN_CINSTANCES; + + //RtlZeroMemory(&PinInstances, sizeof(KSPIN_CINSTANCES)); + Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)&PinInstances, sizeof(KSPIN_CINSTANCES), &BytesReturned); + if (!NT_SUCCESS(Status)) + { + DPRINT("Property Request KSPROPERTY_PIN_GLOBALCINSTANCES failed with %x\n", Status); + return SetIrpIoStatus(Irp, Status, 0); + } + DPRINT1("PinInstances Current %u Max %u\n", PinInstances.CurrentCount, PinInstances.PossibleCount); + + WorkItem = IoAllocateWorkItem(DeviceObject); + if (!WorkItem) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* create worker context */ + WorkerContext = ExAllocatePool(NonPagedPool, sizeof(PIN_WORKER_CONTEXT)); + if (!WorkerContext) + { + /* invalid parameters */ + IoFreeWorkItem(WorkItem); + return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); + } + + /* create worker context */ + DispatchContext = ExAllocatePool(NonPagedPool, sizeof(DISPATCH_CONTEXT)); + if (!DispatchContext) + { + /* invalid parameters */ + IoFreeWorkItem(WorkItem); + ExFreePool(WorkerContext); + return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); + } + /* prepare context */ + RtlZeroMemory(WorkerContext, sizeof(PIN_WORKER_CONTEXT)); + RtlZeroMemory(DispatchContext, sizeof(DISPATCH_CONTEXT)); + + if (PinInstances.CurrentCount == PinInstances.PossibleCount) + { + /* pin already exists */ + DPRINT1("Pins %p\n", Entry->Pins); + DbgBreakPoint(); + ASSERT(Entry->Pins[PinConnect->PinId].PinHandle != NULL); + + if (Entry->Pins[PinConnect->PinId].References != 0) + { + /* FIXME need ksmixer */ + DPRINT1("Device %u Pin %u is already occupied, try later\n", InstanceInfo->DeviceNumber, PinConnect->PinId); + IoFreeWorkItem(WorkItem); + ExFreePool(WorkerContext); + ExFreePool(DispatchContext); + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } + /* re-using pin */ + PropertyRequest.Set = KSPROPSETID_Connection; + PropertyRequest.Flags = KSPROPERTY_TYPE_SET; + PropertyRequest.Id = KSPROPERTY_CONNECTION_DATAFORMAT; + + /* get pin file object */ + Status = ObReferenceObjectByHandle(Entry->Pins[PinConnect->PinId].PinHandle, + GENERIC_READ | GENERIC_WRITE, + IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to get pin file object with %x\n", Status); + IoFreeWorkItem(WorkItem); + ExFreePool(WorkerContext); + ExFreePool(DispatchContext); + return SetIrpIoStatus(Irp, Status, 0); + } + + Length -= sizeof(KSPIN_CONNECT) + sizeof(SYSAUDIO_INSTANCE_INFO); + Status = KsSynchronousIoControlDevice(FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PropertyRequest, sizeof(KSPROPERTY), + (PVOID)(PinConnect + 1), Length, &BytesReturned); + + ObDereferenceObject(FileObject); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to set format with Status %x\n", Status); + IoFreeWorkItem(WorkItem); + ExFreePool(WorkerContext); + ExFreePool(DispatchContext); + return SetIrpIoStatus(Irp, Status, 0); + } + + } + else + { + /* create the real pin */ + WorkerContext->CreateRealPin = TRUE; + } + + /* set up context */ + + WorkerContext->DispatchContext = DispatchContext; + WorkerContext->Entry = Entry; + WorkerContext->Irp = Irp; + WorkerContext->PinConnect = PinConnect; + WorkerContext->AudioClient = ClientInfo; + + DPRINT("Queing Irp %p\n", Irp); + /* queue the work item */ + IoMarkIrpPending(Irp); + Irp->IoStatus.Status = STATUS_PENDING; + Irp->IoStatus.Information = 0; + IoQueueWorkItem(WorkItem, CreatePinWorkerRoutine, DelayedWorkQueue, (PVOID)WorkerContext); + + /* mark irp as pending */ + return STATUS_PENDING; + } } RtlStringFromGUID(&Property->Set, &GuidString); @@ -288,5 +635,3 @@ return Status; } - - Modified: trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -66,7 +66,11 @@ PIRP Irp) { DPRINT1("Dispatch_fnFlush called DeviceObject %p Irp %p\n", DeviceObject); - + //FIXME + // cleanup resources + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } @@ -76,9 +80,39 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PSYSAUDIO_CLIENT Client; + PIO_STACK_LOCATION IoStatus; + ULONG Index; + + DPRINT1("Dispatch_fnClose called DeviceObject %p Irp %p\n", DeviceObject); - + IoStatus = IoGetCurrentIrpStackLocation(Irp); + + Client = (PSYSAUDIO_CLIENT)IoStatus->FileObject->FsContext2; + + DPRINT1("Client %p NumDevices %u\n", Client, Client->NumDevices); + for(Index = 0; Index < Client->NumDevices; Index++) + { + if (Client->Handels[Index]) + { + ZwClose(Client->Handels[Index]); + } + } + + if (Client->Handels) + ExFreePool(Client->Handels); + + if (Client->Devices) + ExFreePool(Client->Devices); + + ExFreePool(Client); + + //FIXME + // cleanup resources + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } @@ -175,61 +209,6 @@ Dispatch_fnFastWrite, }; -VOID -NTAPI -CreatePinWorkerRoutine( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context) -{ - NTSTATUS Status; - HANDLE PinHandle; - HANDLE * Handels; - PFILE_OBJECT FileObject; - PIRP Irp; - PPIN_WORKER_CONTEXT WorkerContext = (PPIN_WORKER_CONTEXT)Context; - - Handels = ExAllocatePool(NonPagedPool, (WorkerContext->Entry->NumberOfPins + 1) * sizeof(HANDLE)); - if (!Handels) - { - DPRINT1("No Memory \n"); - WorkerContext->Irp->IoStatus.Status = STATUS_NO_MEMORY; - WorkerContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(WorkerContext->Irp, IO_SOUND_INCREMENT); - return; - } - - - Status = KsCreatePin(WorkerContext->Entry->Handle, WorkerContext->PinConnect, GENERIC_READ | GENERIC_WRITE, &PinHandle); - DPRINT1("KsCreatePin status %x\n", Status); - - if (NT_SUCCESS(Status)) - { - Status = ObReferenceObjectByHandle(PinHandle, GENERIC_READ | GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); - if (NT_SUCCESS(Status)) - { - Status = CreateDispatcher(WorkerContext->Irp, PinHandle, FileObject); - DPRINT1("Pins %x\n", WorkerContext->Entry->NumberOfPins); - if (WorkerContext->Entry->NumberOfPins) - { - RtlMoveMemory(Handels, WorkerContext->Entry->Pins, WorkerContext->Entry->NumberOfPins * sizeof(HANDLE)); - ExFreePool(WorkerContext->Entry->Pins); - } - Handels[WorkerContext->Entry->NumberOfPins-1] = PinHandle; - WorkerContext->Entry->Pins = Handels; - WorkerContext->Entry->NumberOfPins++; - } - } - - DPRINT1("CreatePinWorkerRoutine completing irp\n"); - WorkerContext->Irp->IoStatus.Status = Status; - WorkerContext->Irp->IoStatus.Information = 0; - - Irp = WorkerContext->Irp; - ExFreePool(Context); - - IoCompleteRequest(Irp, IO_SOUND_INCREMENT); -} - NTSTATUS NTAPI DispatchCreateSysAudio( @@ -242,12 +221,7 @@ PKSOBJECT_CREATE_ITEM CreateItem; PIO_STACK_LOCATION IoStatus; LPWSTR Buffer; - ULONG Length, DeviceIndex; - PSYSAUDIODEVEXT DeviceExtension; - PKSAUDIO_DEVICE_ENTRY Entry; - KSPIN_CONNECT * PinConnect; - PIO_WORKITEM WorkItem; - PPIN_WORKER_CONTEXT Context; + static LPWSTR KS_NAME_PIN = L"{146F1A80-4791-11D0-A5D6-28DB04C10000}"; IoStatus = IoGetCurrentIrpStackLocation(Irp); @@ -260,57 +234,12 @@ /* is the request for a new pin */ if (!wcsncmp(KS_NAME_PIN, Buffer, wcslen(KS_NAME_PIN))) { - Client = (PSYSAUDIO_CLIENT)Irp->Tail.Overlay.OriginalFileObject->FsContext2; - DeviceExtension = (PSYSAUDIODEVEXT)DeviceObject->DeviceExtension; - if (Client) - { - ASSERT(Client->NumDevices >= 1); - DeviceIndex = Client->Devices[Client->NumDevices-1]; - } - else - { - DPRINT1("Warning: using HACK\n"); - DeviceIndex = 0; - } - ASSERT(DeviceIndex < DeviceExtension->NumberOfKsAudioDevices); - Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, DeviceIndex); - ASSERT(Entry); - - Length = (IoStatus->FileObject->FileName.Length - ((wcslen(KS_NAME_PIN)+1) * sizeof(WCHAR))); - PinConnect = ExAllocatePool(NonPagedPool, Length); - if (!PinConnect) - { - Irp->IoStatus.Status = STATUS_NO_MEMORY; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_NO_MEMORY; - } - RtlMoveMemory(PinConnect, IoStatus->FileObject->FileName.Buffer + (wcslen(KS_NAME_PIN)+1), Length); - Context = ExAllocatePool(NonPagedPool, sizeof(PIN_WORKER_CONTEXT)); - if (!Context) - { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INSUFFICIENT_RESOURCES; - } - Context->PinConnect = PinConnect; - Context->Entry = Entry; - Context->Irp = Irp; - - WorkItem = IoAllocateWorkItem(DeviceObject); - if (!WorkItem) - { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INSUFFICIENT_RESOURCES; - } - IoQueueWorkItem(WorkItem, CreatePinWorkerRoutine, DelayedWorkQueue, (PVOID)Context); + Status = CreateDispatcher(Irp); + DPRINT1("Virtual pin Status %x\n", Status); Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_PENDING; - IoMarkIrpPending(Irp); - return STATUS_PENDING; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; } } @@ -341,6 +270,10 @@ Status = KsAllocateObjectHeader(&ObjectHeader, 1, CreateItem, Irp, &DispatchTable); DPRINT1("KsAllocateObjectHeader result %x\n", Status); + /* complete the irp */ + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } Modified: trunk/reactos/drivers/wdm/audio/sysaudio/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -23,18 +23,16 @@ PIRP Irp) { PDISPATCH_CONTEXT Context; - PKSOBJECT_CREATE_ITEM CreateItem; NTSTATUS Status; ULONG BytesReturned; PIO_STACK_LOCATION IoStack; DPRINT1("Pin_fnDeviceIoControl called DeviceObject %p Irp %p\n", DeviceObject); - /* access the create item */ - CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp); - Context = (PDISPATCH_CONTEXT)CreateItem->Context; - IoStack = IoGetCurrentIrpStackLocation(Irp); + + Context = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext2; + ASSERT(Context); Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.Type3InputBuffer, @@ -84,18 +82,16 @@ PIRP Irp) { PDISPATCH_CONTEXT Context; - PKSOBJECT_CREATE_ITEM CreateItem; PIO_STACK_LOCATION IoStack; ULONG BytesReturned; NTSTATUS Status; DPRINT1("Pin_fnWrite called DeviceObject %p Irp %p\n", DeviceObject); - /* access the create item */ - CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp); - Context = (PDISPATCH_CONTEXT)CreateItem->Context; - IoStack = IoGetCurrentIrpStackLocation(Irp); + + Context = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext2; + ASSERT(Context); Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IOCTL_KS_WRITE_STREAM, IoStack->Parameters.DeviceIoControl.Type3InputBuffer, @@ -228,34 +224,12 @@ NTSTATUS CreateDispatcher( - IN PIRP Irp, - IN HANDLE Handle, - IN PFILE_OBJECT FileObject) -{ - PKSOBJECT_CREATE_ITEM CreateItem; + IN PIRP Irp) +{ NTSTATUS Status; KSOBJECT_HEADER ObjectHeader; - PDISPATCH_CONTEXT Context; - - /* allocate create item */ - CreateItem = ExAllocatePool(NonPagedPool, sizeof(KSOBJECT_CREATE_ITEM)); - if (!CreateItem) - return STATUS_INSUFFICIENT_RESOURCES; - - Context = ExAllocatePool(NonPagedPool, sizeof(DISPATCH_CONTEXT)); - if (!Context) - { - ExFreePool(CreateItem); - return STATUS_INSUFFICIENT_RESOURCES; - } - - Context->Handle = Handle; - Context->FileObject = FileObject; - - - CreateItem->Context = (PVOID)Context; /* allocate object header */ - Status = KsAllocateObjectHeader(&ObjectHeader, 1, CreateItem, Irp, &PinTable); + Status = KsAllocateObjectHeader(&ObjectHeader, 0, NULL, Irp, &PinTable); return Status; } Modified: trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] Sun Feb 22 21:58:51 2009 @@ -5,8 +5,15 @@ { ULONG NumDevices; PULONG Devices; + PHANDLE Handels; }SYSAUDIO_CLIENT, *PSYSAUDIO_CLIENT; + +typedef struct +{ + HANDLE PinHandle; + ULONG References; +}PIN_INFO; typedef struct @@ -18,7 +25,7 @@ ULONG NumberOfClients; ULONG NumberOfPins; - HANDLE * Pins; + PIN_INFO * Pins; }KSAUDIO_DEVICE_ENTRY, *PKSAUDIO_DEVICE_ENTRY; @@ -38,17 +45,22 @@ typedef struct { - PIRP Irp; - PKSAUDIO_DEVICE_ENTRY Entry; - KSPIN_CONNECT * PinConnect; + HANDLE Handle; + PFILE_OBJECT FileObject; + ULONG PinId; + PKSAUDIO_DEVICE_ENTRY AudioEntry; -}PIN_WORKER_CONTEXT, *PPIN_WORKER_CONTEXT; +}DISPATCH_CONTEXT, *PDISPATCH_CONTEXT; typedef struct { - HANDLE Handle; - PFILE_OBJECT FileObject; -}DISPATCH_CONTEXT, *PDISPATCH_CONTEXT; + PIRP Irp; + BOOL CreateRealPin; + PKSAUDIO_DEVICE_ENTRY Entry; + KSPIN_CONNECT * PinConnect; + PDISPATCH_CONTEXT DispatchContext; + PSYSAUDIO_CLIENT AudioClient; +}PIN_WORKER_CONTEXT, *PPIN_WORKER_CONTEXT; NTSTATUS SysAudioAllocateDeviceHeader( @@ -75,8 +87,6 @@ NTSTATUS CreateDispatcher( - IN PIRP Irp, - IN HANDLE Handle, - IN PFILE_OBJECT FileObject); + IN PIRP Irp); #endif
15 years, 10 months
1
0
0
0
[dchapyshev] 39714: - Add snmpapi from Wine
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Feb 22 17:21:45 2009 New Revision: 39714 URL:
http://svn.reactos.org/svn/reactos?rev=39714&view=rev
Log: - Add snmpapi from Wine Added: trunk/reactos/dll/win32/snmpapi/main.c (with props) Modified: trunk/reactos/dll/win32/snmpapi/snmpapi.c trunk/reactos/dll/win32/snmpapi/snmpapi.rbuild trunk/reactos/media/doc/README.WINE Added: trunk/reactos/dll/win32/snmpapi/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/snmpapi/main.c?r…
============================================================================== --- trunk/reactos/dll/win32/snmpapi/main.c (added) +++ trunk/reactos/dll/win32/snmpapi/main.c [iso-8859-1] Sun Feb 22 17:21:45 2009 @@ -1,0 +1,634 @@ +/* + * Implementation of SNMPAPI.DLL + * + * Copyright 2002 Patrik Stridvall + * Copyright 2007 Hans Leidekker + * + * 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 + */ + +#include <stdio.h> +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "snmp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(snmpapi); + +static INT asn_any_copy(AsnAny *dst, const AsnAny *src) +{ + memset(dst, 0, sizeof(AsnAny)); + switch (src->asnType) + { + case ASN_INTEGER32: dst->asnValue.number = src->asnValue.number; break; + case ASN_UNSIGNED32: dst->asnValue.unsigned32 = src->asnValue.unsigned32; break; + case ASN_COUNTER64: dst->asnValue.counter64 = src->asnValue.counter64; break; + case ASN_COUNTER32: dst->asnValue.counter = src->asnValue.counter; break; + case ASN_GAUGE32: dst->asnValue.gauge = src->asnValue.gauge; break; + case ASN_TIMETICKS: dst->asnValue.ticks = src->asnValue.ticks; break; + + case ASN_OCTETSTRING: + case ASN_BITS: + case ASN_SEQUENCE: + case ASN_IPADDRESS: + case ASN_OPAQUE: + { + BYTE *stream; + UINT length = src->asnValue.string.length; + + if (!(stream = HeapAlloc(GetProcessHeap(), 0, length))) return SNMPAPI_ERROR; + memcpy(stream, src->asnValue.string.stream, length); + + dst->asnValue.string.stream = stream; + dst->asnValue.string.length = length; + dst->asnValue.string.dynamic = TRUE; + break; + } + case ASN_OBJECTIDENTIFIER: + { + UINT *ids, i, size = src->asnValue.object.idLength * sizeof(UINT); + + if (!(ids = HeapAlloc(GetProcessHeap(), 0, size))) return SNMPAPI_ERROR; + + dst->asnValue.object.ids = ids; + dst->asnValue.object.idLength = src->asnValue.object.idLength; + + for (i = 0; i < dst->asnValue.object.idLength; i++) + dst->asnValue.object.ids[i] = src->asnValue.object.ids[i]; + break; + } + default: + { + WARN("unknown ASN type: %d\n", src->asnType); + return SNMPAPI_ERROR; + } + } + dst->asnType = src->asnType; + return SNMPAPI_NOERROR; +} + +static void asn_any_free(AsnAny *any) +{ + switch (any->asnType) + { + case ASN_OCTETSTRING: + case ASN_BITS: + case ASN_SEQUENCE: + case ASN_IPADDRESS: + case ASN_OPAQUE: + { + if (any->asnValue.string.dynamic) + { + HeapFree(GetProcessHeap(), 0, any->asnValue.string.stream); + any->asnValue.string.stream = NULL; + } + break; + } + case ASN_OBJECTIDENTIFIER: + { + HeapFree(GetProcessHeap(), 0, any->asnValue.object.ids); + any->asnValue.object.ids = NULL; + break; + } + default: break; + } + any->asnType = ASN_NULL; +} + +/*********************************************************************** + * DllMain for SNMPAPI + */ +BOOL WINAPI DllMain( + HINSTANCE hInstDLL, + DWORD fdwReason, + LPVOID lpvReserved) +{ + TRACE("(%p,%d,%p)\n", hInstDLL, fdwReason, lpvReserved); + + switch(fdwReason) { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hInstDLL); + break; + case DLL_PROCESS_DETACH: + break; + } + + return TRUE; +} + +/*********************************************************************** + * SnmpUtilDbgPrint (SNMPAPI.@) + * + * NOTES + * The Microsoft headers claim this function uses the stdcall calling + * convention. But stdcall functions cannot take a variable number of + * arguments so this does not make sense. The stdcall specification is + * probably ignored by Microsoft's compiler in this case. So declare it + * correctly in Wine so it works with all compilers. + */ +VOID WINAPI SnmpUtilDbgPrint(INT loglevel, LPSTR format, ...) +{ + FIXME("(%d, %s)\n", loglevel, debugstr_a(format)); +} + +/*********************************************************************** + * SnmpUtilMemAlloc (SNMPAPI.@) + */ +LPVOID WINAPI SnmpUtilMemAlloc(UINT nbytes) +{ + TRACE("(%d)\n", nbytes); + return HeapAlloc(GetProcessHeap(), 0, nbytes); +} + +/*********************************************************************** + * SnmpUtilMemReAlloc (SNMPAPI.@) + */ +LPVOID WINAPI SnmpUtilMemReAlloc(LPVOID mem, UINT nbytes) +{ + TRACE("(%p, %d)\n", mem, nbytes); + return HeapReAlloc(GetProcessHeap(), 0, mem, nbytes); +} + +/*********************************************************************** + * SnmpUtilMemFree (SNMPAPI.@) + */ +VOID WINAPI SnmpUtilMemFree(LPVOID mem) +{ + TRACE("(%p)\n", mem); + HeapFree(GetProcessHeap(), 0, mem); +} + +/*********************************************************************** + * SnmpUtilAsnAnyCpy (SNMPAPI.@) + */ +INT WINAPI SnmpUtilAsnAnyCpy(AsnAny *dst, AsnAny *src) +{ + TRACE("(%p, %p)\n", dst, src); + return asn_any_copy(dst, src); +} + +/*********************************************************************** + * SnmpUtilAsnAnyFree (SNMPAPI.@) + */ +VOID WINAPI SnmpUtilAsnAnyFree(AsnAny *any) +{ + TRACE("(%p)\n", any); + asn_any_free(any); +} + +/*********************************************************************** + * SnmpUtilOctetsCpy (SNMPAPI.@) + */ +INT WINAPI SnmpUtilOctetsCpy(AsnOctetString *dst, AsnOctetString *src) +{ + TRACE("(%p, %p)\n", dst, src); + + if (!dst) return SNMPAPI_ERROR; + if (!src) + { + dst->dynamic = FALSE; + dst->length = 0; + dst->stream = NULL; + return SNMPAPI_NOERROR; + } + if ((dst->stream = HeapAlloc(GetProcessHeap(), 0, src->length))) + { + unsigned int i; + + dst->dynamic = TRUE; + dst->length = src->length; + for (i = 0; i < dst->length; i++) dst->stream[i] = src->stream[i]; + return SNMPAPI_NOERROR; + } + return SNMPAPI_ERROR; +} + +/*********************************************************************** + * SnmpUtilOctetsFree (SNMPAPI.@) + */ +VOID WINAPI SnmpUtilOctetsFree(AsnOctetString *octets) +{ + TRACE("(%p)\n", octets); + + if (octets) + { + octets->length = 0; + if (octets->dynamic) HeapFree(GetProcessHeap(), 0, octets->stream); + octets->stream = NULL; + octets->dynamic = FALSE; + } +} + +/*********************************************************************** + * SnmpUtilOctetsNCmp (SNMPAPI.@) + */ +INT WINAPI SnmpUtilOctetsNCmp(AsnOctetString *octets1, AsnOctetString *octets2, UINT count) +{ + INT ret; + unsigned int i; + + TRACE("(%p, %p, %d)\n", octets1, octets2, count); + + if (!octets1 || !octets2) return 0; + + for (i = 0; i < count; i++) + if ((ret = octets1->stream[i] - octets2->stream[i])) return ret; + + return 0; +} + +/*********************************************************************** + * SnmpUtilOctetsCmp (SNMPAPI.@) + */ +INT WINAPI SnmpUtilOctetsCmp(AsnOctetString *octets1, AsnOctetString *octets2) +{ + TRACE("(%p, %p)\n", octets1, octets2); + + if (octets1->length < octets2->length) return -1; + if (octets1->length > octets2->length) return 1; + + return SnmpUtilOctetsNCmp(octets1, octets2, octets1->length); +} + +/*********************************************************************** + * SnmpUtilOidAppend (SNMPAPI.@) + */ +INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *dst, AsnObjectIdentifier *src) +{ + UINT *ids, i, size; + + TRACE("(%p, %p)\n", dst, src); + + if (!dst) return SNMPAPI_ERROR; + if (!src) return SNMPAPI_NOERROR; + + size = (src->idLength + dst->idLength) * sizeof(UINT); + if (!(ids = HeapReAlloc(GetProcessHeap(), 0, dst->ids, size))) + { + if (!(ids = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(SNMP_MEM_ALLOC_ERROR); + return SNMPAPI_ERROR; + } + else memcpy(ids, dst->ids, dst->idLength * sizeof(UINT)); + } + + for (i = 0; i < src->idLength; i++) ids[i + dst->idLength] = src->ids[i]; + dst->idLength = dst->idLength + src->idLength; + dst->ids = ids; + + return SNMPAPI_NOERROR; +} + +/*********************************************************************** + * SnmpUtilOidCpy (SNMPAPI.@) + */ +INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src) +{ + TRACE("(%p, %p)\n", dst, src); + + if (!dst) return SNMPAPI_ERROR; + if (!src) + { + dst->idLength = 0; + dst->ids = NULL; + return SNMPAPI_NOERROR; + } + if ((dst->ids = HeapAlloc(GetProcessHeap(), 0, src->idLength * sizeof(UINT)))) + { + unsigned int i; + + dst->idLength = src->idLength; + for (i = 0; i < dst->idLength; i++) dst->ids[i] = src->ids[i]; + return SNMPAPI_NOERROR; + } + return SNMPAPI_ERROR; +} + +/*********************************************************************** + * SnmpUtilOidFree (SNMPAPI.@) + */ +VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *oid) +{ + TRACE("(%p)\n", oid); + + if (!oid) return; + + oid->idLength = 0; + HeapFree(GetProcessHeap(), 0, oid->ids); + oid->ids = NULL; +} + +/*********************************************************************** + * SnmpUtilOidNCmp (SNMPAPI.@) + */ +INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count) +{ + unsigned int i, len; + + TRACE("(%p, %p, %d)\n", oid1, oid2, count); + + if (!oid1 || !oid2) return 0; + + len = min(count, oid1->idLength); + len = min(len, oid2->idLength); + for (i = 0; i < len; i++) + { + if (oid1->ids[i] > oid2->ids[i]) return 1; + if (oid1->ids[i] < oid2->ids[i]) return -1; + } + if (i == count) return 0; + if (oid1->idLength < oid2->idLength) return -1; + if (oid1->idLength > oid2->idLength) return 1; + return 0; +} + +/*********************************************************************** + * SnmpUtilOidCmp (SNMPAPI.@) + */ +INT WINAPI SnmpUtilOidCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2) +{ + TRACE("(%p, %p)\n", oid1, oid2); + + if (oid1->idLength < oid2->idLength) return -1; + if (oid1->idLength > oid2->idLength) return 1; + + return SnmpUtilOidNCmp(oid1, oid2, oid1->idLength); +} + +/*********************************************************************** + * SnmpUtilVarBindCpy (SNMPAPI.@) + */ +INT WINAPI SnmpUtilVarBindCpy(SnmpVarBind *dst, SnmpVarBind *src) +{ + unsigned int i, size; + + TRACE("(%p, %p)\n", dst, src); + + if (!dst) return SNMPAPI_ERROR; + if (!src) + { + dst->value.asnType = ASN_NULL; + return SNMPAPI_NOERROR; + } + + size = src->name.idLength * sizeof(UINT); + if (!(dst->name.ids = HeapAlloc(GetProcessHeap(), 0, size))) return SNMPAPI_ERROR; + + for (i = 0; i < src->name.idLength; i++) dst->name.ids[i] = src->name.ids[i]; + dst->name.idLength = src->name.idLength; + + if (!asn_any_copy(&dst->value, &src->value)) + { + HeapFree(GetProcessHeap(), 0, dst->name.ids); + return SNMPAPI_ERROR; + } + return SNMPAPI_NOERROR; +} + +/*********************************************************************** + * SnmpUtilVarBindFree (SNMPAPI.@) + */ +VOID WINAPI SnmpUtilVarBindFree(SnmpVarBind *vb) +{ + TRACE("(%p)\n", vb); + + if (!vb) return; + + asn_any_free(&vb->value); + HeapFree(GetProcessHeap(), 0, vb->name.ids); + vb->name.idLength = 0; + vb->name.ids = NULL; +} + +/*********************************************************************** + * SnmpUtilVarBindListCpy (SNMPAPI.@) + */ +INT WINAPI SnmpUtilVarBindListCpy(SnmpVarBindList *dst, SnmpVarBindList *src) +{ + unsigned int i, size; + SnmpVarBind *src_entry, *dst_entry; + + TRACE("(%p, %p)\n", dst, src); + + if (!src) + { + dst->list = NULL; + dst->len = 0; + return SNMPAPI_NOERROR; + } + size = src->len * sizeof(SnmpVarBind); + if (!(dst->list = HeapAlloc(GetProcessHeap(), 0, size))) + return SNMPAPI_ERROR; + + src_entry = src->list; + dst_entry = dst->list; + for (i = 0; i < src->len; i++) + { + if (SnmpUtilVarBindCpy(dst_entry, src_entry)) + { + src_entry++; + dst_entry++; + } + else + { + for (--i; i > 0; i--) SnmpUtilVarBindFree(--dst_entry); + HeapFree(GetProcessHeap(), 0, dst->list); + return SNMPAPI_ERROR; + } + } + dst->len = src->len; + return SNMPAPI_NOERROR; +} + +/*********************************************************************** + * SnmpUtilVarBindListFree (SNMPAPI.@) + */ +VOID WINAPI SnmpUtilVarBindListFree(SnmpVarBindList *vb) +{ + unsigned int i; + SnmpVarBind *entry; + + TRACE("(%p)\n", vb); + + entry = vb->list; + for (i = 0; i < vb->len; i++) SnmpUtilVarBindFree(entry++); + HeapFree(GetProcessHeap(), 0, vb->list); + vb->list = NULL; + vb->len = 0; +} + +/*********************************************************************** + * SnmpUtilIdsToA (SNMPAPI.@) + */ +LPSTR WINAPI SnmpUtilIdsToA(UINT *ids, UINT length) +{ + static char one[10], oid[514], null_oid[] = "<null oid>"; + unsigned int i, len, left = sizeof(oid) - 1; + + TRACE("(%p, %d)\n", ids, length); + + if (!ids || !length) return null_oid; + + *oid = 0; + for (i = 0; i < length; i++) + { + sprintf(one, "%d", ids[i]); + len = strlen(one); + if (left >= len) + { + strcat(oid, one); + left -= len; + } + else return oid; + + if (i < length - 1) + { + if (left > 0) + { + strcat(oid, "."); + left--; + } + else return oid; + } + } + return oid; +} + +/*********************************************************************** + * SnmpUtilOidToA (SNMPAPI.@) + */ +LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid) +{ + static char null_oid[] = "<null oid>"; + + TRACE("(%p)\n", oid); + + if (oid) + return SnmpUtilIdsToA(oid->ids, oid->idLength); + else + return null_oid; +} + +/*********************************************************************** + * SnmpUtilPrintOid (SNMPAPI.@) + */ +VOID WINAPI SnmpUtilPrintOid(AsnObjectIdentifier *oid) +{ + unsigned int i; + + TRACE("(%p)\n", oid); + + if (!oid) return; + + for (i = 0; i < oid->idLength; i++) + { + TRACE("%u", oid->ids[i]); + if (i < oid->idLength - 1) TRACE("."); + } + TRACE("\n"); +} + +/*********************************************************************** + * SnmpUtilPrintAsnAny (SNMPAPI.@) + */ +VOID WINAPI SnmpUtilPrintAsnAny(AsnAny *any) +{ + unsigned int i; + + TRACE("(%p)\n", any); + + switch (any->asnType) + { + case ASN_NULL: TRACE("Null value\n"); return; + case ASN_INTEGER32: TRACE("Integer32 %d\n", any->asnValue.number); return; + case ASN_UNSIGNED32: TRACE("Unsigned32 %u\n", any->asnValue.unsigned32); return; + case ASN_COUNTER32: TRACE("Counter32 %u\n", any->asnValue.counter); return; + case ASN_GAUGE32: TRACE("Gauge32 %u\n", any->asnValue.gauge); return; + case ASN_TIMETICKS: TRACE("Timeticks %u\n", any->asnValue.ticks); return; + case ASN_COUNTER64: + { + TRACE("Counter64 %x%08x\n", (DWORD)(any->asnValue.counter64.QuadPart>>32),(DWORD)any->asnValue.counter64.QuadPart); + return; + } + case ASN_OCTETSTRING: + { + TRACE("String "); + for (i = 0; i < any->asnValue.string.length; i++) + TRACE("%c", any->asnValue.string.stream[i]); + TRACE("\n"); + return; + } + case ASN_IPADDRESS: + { + TRACE("IpAddress "); + if (any->asnValue.string.length < 4) + { + TRACE("Invalid\n"); + return; + } + for (i = 0; i < 4; i++) + { + TRACE("%u", any->asnValue.string.stream[i]); + if (i < 3) TRACE("."); + } + TRACE("\n"); + return; + } + case ASN_BITS: + { + TRACE("Bits "); + for (i = 0; i < any->asnValue.string.length; i++) + { + TRACE("0x%02x", any->asnValue.string.stream[i]); + if (i < any->asnValue.object.idLength - 1) TRACE(" "); + } + TRACE("\n"); + return; + } + case ASN_OPAQUE: + { + TRACE("Opaque "); + for (i = 0; i < any->asnValue.string.length; i++) + { + TRACE("0x%02x", any->asnValue.string.stream[i]); + if (i < any->asnValue.object.idLength - 1) TRACE(" "); + } + TRACE("\n"); + return; + } + case ASN_OBJECTIDENTIFIER: + { + TRACE("ObjectID "); + for (i = 0; i < any->asnValue.object.idLength; i++) + { + TRACE("%u", any->asnValue.object.ids[i]); + if (i < any->asnValue.object.idLength - 1) TRACE("."); + } + TRACE("\n"); + return; + } + default: + { + TRACE("Invalid type %d\n", any->asnType); + return; + } + } +} Propchange: trunk/reactos/dll/win32/snmpapi/main.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/snmpapi/snmpapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/snmpapi/snmpapi.…
============================================================================== --- trunk/reactos/dll/win32/snmpapi/snmpapi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/snmpapi/snmpapi.c [iso-8859-1] Sun Feb 22 17:21:45 2009 @@ -39,34 +39,6 @@ /* To make the linker happy */ //VOID WINAPI KeBugCheck (ULONG BugCheckCode) {} - - -BOOL -EXPORT -DllMain(HANDLE hInstDll, - ULONG dwReason, - PVOID Reserved) -{ - WSH_DbgPrint(MIN_TRACE, ("DllMain of snmpapi.dll\n")); - - switch (dwReason) { - case DLL_PROCESS_ATTACH: - /* Don't need thread attach notifications - so disable them to improve performance */ - DisableThreadLibraryCalls(hInstDll); - break; - - case DLL_THREAD_ATTACH: - break; - - case DLL_THREAD_DETACH: - break; - - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} //////////////////////////////////////////////////////////////////////////////// /* @@ -119,42 +91,6 @@ /* * @implemented */ -LPVOID -SNMP_FUNC_TYPE -SnmpUtilMemAlloc(UINT nBytes) -{ - VOID* pMem = NULL; - pMem = GlobalAlloc(GPTR, nBytes); - return pMem; -} - - -/* - * @implemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilMemFree(LPVOID pMem) -{ - GlobalFree(pMem); -} - - -/* - * @unimplemented - */ -LPVOID -SNMP_FUNC_TYPE -SnmpUtilMemReAlloc(LPVOID pMem, UINT nBytes) -{ - pMem = GlobalReAlloc(pMem, nBytes, GPTR); - return pMem; -} - - -/* - * @implemented - */ VOID SNMP_FUNC_TYPE SnmpSvcInitUptime() @@ -268,208 +204,6 @@ /* * @unimplemented */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilAsnAnyCpy(AsnAny *pAnyDst, AsnAny *pAnySrc) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilAsnAnyFree(AsnAny *pAny) -{ - UNIMPLEMENTED -} - - -/* - * @unimplemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilDbgPrint(INT nLogLevel, LPSTR szFormat, ...) -{ - switch (nLogLevel) { - case SNMP_LOG_SILENT: - break; - case SNMP_LOG_FATAL: - break; - case SNMP_LOG_ERROR: - break; - case SNMP_LOG_WARNING: - break; - case SNMP_LOG_TRACE: - break; - case SNMP_LOG_VERBOSE: - break; - } - UNIMPLEMENTED -} - - -/* - * @unimplemented - */ -LPSTR -SNMP_FUNC_TYPE -SnmpUtilIdsToA(UINT *Ids, UINT IdLength) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilOctetsCmp(AsnOctetString *pOctets1, AsnOctetString *pOctets2) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilOctetsCpy(AsnOctetString *pOctetsDst, AsnOctetString *pOctetsSrc) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilOctetsFree(AsnOctetString *pOctets) -{ - UNIMPLEMENTED -} - - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilOctetsNCmp(AsnOctetString *pOctets1, AsnOctetString *pOctets2, UINT nChars) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilOidAppend(AsnObjectIdentifier *pOidDst, AsnObjectIdentifier *pOidSrc) -{ - //SnmpUtilMemReAlloc(pOidDst, sizeof(AsnObjectIdentifier)); - //SetLastError(SNMP_BERAPI_OVERFLOW); - SetLastError(SNMP_MEM_ALLOC_ERROR); - return 0; // failed -} - - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilOidCmp(AsnObjectIdentifier *pOid1, AsnObjectIdentifier *pOid2) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilOidCpy(AsnObjectIdentifier *pOidDst, AsnObjectIdentifier *pOidSrc) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilOidFree(AsnObjectIdentifier *pOid) -{ - UNIMPLEMENTED -} - - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilOidNCmp(AsnObjectIdentifier *pOid1, AsnObjectIdentifier *pOid2, UINT nSubIds) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -LPSTR -SNMP_FUNC_TYPE -SnmpUtilOidToA(AsnObjectIdentifier *Oid) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilPrintAsnAny(AsnAny *pAny) -{ - UNIMPLEMENTED -} - - -/* - * @unimplemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilPrintOid(AsnObjectIdentifier *Oid) -{ - UNIMPLEMENTED -} - - -/* - * @unimplemented - */ VOID SNMP_FUNC_TYPE SnmpUtilUTF8ToUnicode(void* unknown, void* unknown2) @@ -499,51 +233,5 @@ UNIMPLEMENTED } - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilVarBindCpy(SnmpVarBind *pVbDst, SnmpVarBind *pVbSrc) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilVarBindFree(SnmpVarBind *pVb) -{ - UNIMPLEMENTED -} - - -/* - * @unimplemented - */ -SNMPAPI -SNMP_FUNC_TYPE -SnmpUtilVarBindListCpy(SnmpVarBindList *pVblDst, SnmpVarBindList *pVblSrc) -{ - UNIMPLEMENTED - return 0; -} - - -/* - * @unimplemented - */ -VOID -SNMP_FUNC_TYPE -SnmpUtilVarBindListFree(SnmpVarBindList *pVbl) -{ - UNIMPLEMENTED -} - /* EOF */ Modified: trunk/reactos/dll/win32/snmpapi/snmpapi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/snmpapi/snmpapi.…
============================================================================== --- trunk/reactos/dll/win32/snmpapi/snmpapi.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/snmpapi/snmpapi.rbuild [iso-8859-1] Sun Feb 22 17:21:45 2009 @@ -1,9 +1,13 @@ <module name="snmpapi" type="win32dll" baseaddress="${BASEADDRESS_SNMPAPI}" installbase="system32" installname="snmpapi.dll" unicode="yes"> <importlibrary definition="snmpapi.spec" /> <include base="snmpapi">.</include> + <include base="ReactOS">include/reactos/wine</include> + <define name="__WINESRC__" /> <define name="_DISABLE_TIDENTS" /> <library>ntdll</library> <library>kernel32</library> + <library>wine</library> + <file>main.c</file> <file>snmpapi.c</file> <file>snmpapi.rc</file> </module> Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Feb 22 17:21:45 2009 @@ -172,6 +172,9 @@ reactos/lib/sdk/crt/wine/undname.c # Synced at XXXXXXXX reactos/lib/sdk/crt/thread/thread.c # Synced at 20080604 +snmpapi - + reactos/dll/win32/snmpapi/main.c # Synced at 20090222 + User32 - reactos/dll/win32/user32/controls/button.c # Synced to Wine-1_1_13 reactos/dll/win32/user32/controls/combo.c # Synced to Wine-1_1_13
15 years, 10 months
1
0
0
0
[spetreolle] 39713: add missing \n in traces
by spetreolle@svn.reactos.org
Author: spetreolle Date: Sun Feb 22 17:07:18 2009 New Revision: 39713 URL:
http://svn.reactos.org/svn/reactos?rev=39713&view=rev
Log: add missing \n in traces Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Sun Feb 22 17:07:18 2009 @@ -53,7 +53,7 @@ if ( KernelHandle == INVALID_HANDLE_VALUE ) { - SND_ERR(L"Failed to open %s", KERNEL_DEVICE_NAME); + SND_ERR(L"Failed to open %s\n", KERNEL_DEVICE_NAME); CleanupEntrypointMutexes(); UnlistAllSoundDevices(); @@ -103,7 +103,7 @@ case DRV_QUERYCONFIGURE : { - SND_TRACE(L"DRV_QUERYCONFIGURE"); + SND_TRACE(L"DRV_QUERYCONFIGURE\n"); return 0L; } case DRV_CONFIGURE :
15 years, 10 months
1
0
0
0
[jimtabor] 39712: - Patch by Evgeniy Boltik: Fixes HatchBrushes, see bug 4107.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Feb 22 17:04:31 2009 New Revision: 39712 URL:
http://svn.reactos.org/svn/reactos?rev=39712&view=rev
Log: - Patch by Evgeniy Boltik: Fixes HatchBrushes, see bug 4107. Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] Sun Feb 22 17:04:31 2009 @@ -27,11 +27,11 @@ static const USHORT HatchBrushes[NB_HATCH_STYLES][8] = { - {0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00}, /* HS_HORIZONTAL */ + {0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00}, /* HS_HORIZONTAL */ {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}, /* HS_VERTICAL */ {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}, /* HS_FDIAGONAL */ {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}, /* HS_BDIAGONAL */ - {0x08, 0x08, 0x08, 0xff, 0x08, 0x08, 0x08, 0x08}, /* HS_CROSS */ + {0x08, 0x08, 0x08, 0x08, 0xff, 0x08, 0x08, 0x08}, /* HS_CROSS */ {0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81} /* HS_DIAGCROSS */ };
15 years, 10 months
1
0
0
0
[dchapyshev] 39711: - pSetupGetFileTitle calling MyGetFileTitle
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Feb 22 16:54:51 2009 New Revision: 39711 URL:
http://svn.reactos.org/svn/reactos?rev=39711&view=rev
Log: - pSetupGetFileTitle calling MyGetFileTitle Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sun Feb 22 16:54:51 2009 @@ -552,7 +552,7 @@ @ stub pSetupFreeStringArray @ stub pSetupGetCurrentDriverSigningPolicy @ stdcall pSetupGetField(ptr long) -@ stub pSetupGetFileTitle +@ stdcall pSetupGetFileTitle(wstr) MyGetFileTitle @ stdcall pSetupGetGlobalFlags() @ stub pSetupGetInfSections @ stdcall pSetupGetQueueFlags(ptr) @@ -621,7 +621,6 @@ @ stub LookUpStringInTable @ stub MemoryInitialize @ stub MultiSzFromSearchControl -@ stdcall MyGetFileTitle(wstr) @ stdcall QueryRegistryValue(long wstr ptr ptr ptr) @ stub ReadAsciiOrUnicodeTextFile # Yes, Microsoft really misspelled this one!
15 years, 10 months
1
0
0
0
[dchapyshev] 39710: - Add CheckTokenMembership to winbase.h - Use CheckTokenMembership in IsUserAdmin
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Feb 22 16:39:21 2009 New Revision: 39710 URL:
http://svn.reactos.org/svn/reactos?rev=39710&view=rev
Log: - Add CheckTokenMembership to winbase.h - Use CheckTokenMembership in IsUserAdmin Modified: trunk/reactos/dll/win32/setupapi/misc.c trunk/reactos/include/psdk/winbase.h Modified: trunk/reactos/dll/win32/setupapi/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/misc.c?…
============================================================================== --- trunk/reactos/dll/win32/setupapi/misc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/misc.c [iso-8859-1] Sun Feb 22 16:39:21 2009 @@ -1694,62 +1694,22 @@ IsUserAdmin(VOID) { SID_IDENTIFIER_AUTHORITY Authority = {SECURITY_NT_AUTHORITY}; - HANDLE hToken; - DWORD dwSize; - PTOKEN_GROUPS lpGroups; + BOOL bResult = FALSE; PSID lpSid; - DWORD i; - BOOL bResult = FALSE; - - if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) - { - return FALSE; - } - - if (!GetTokenInformation(hToken, TokenGroups, NULL, 0, &dwSize)) - { - if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) - { - CloseHandle(hToken); - return FALSE; - } - } - - lpGroups = HeapAlloc(GetProcessHeap(), 0, dwSize); - if (lpGroups == NULL) - { - CloseHandle(hToken); - return FALSE; - } - - if (!GetTokenInformation(hToken, TokenGroups, lpGroups, dwSize, &dwSize)) - { - HeapFree(GetProcessHeap(), 0, lpGroups); - CloseHandle(hToken); - return FALSE; - } - - CloseHandle(hToken); if (!AllocateAndInitializeSid(&Authority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &lpSid)) { - HeapFree(GetProcessHeap(), 0, lpGroups); return FALSE; } - for (i = 0; i < lpGroups->GroupCount; i++) - { - if (EqualSid(lpSid, lpGroups->Groups[i].Sid)) - { - bResult = TRUE; - break; - } + if (!CheckTokenMembership(NULL, lpSid, &bResult)) + { + bResult = FALSE; } FreeSid(lpSid); - HeapFree(GetProcessHeap(), 0, lpGroups); return bResult; } Modified: trunk/reactos/include/psdk/winbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winbase.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winbase.h [iso-8859-1] Sun Feb 22 16:39:21 2009 @@ -1151,6 +1151,7 @@ BOOL WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD); BOOL WINAPI AdjustTokenPrivileges(HANDLE,BOOL,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD); BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID*); +BOOL WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL); BOOL WINAPI AllocateLocallyUniqueId(PLUID); BOOL WINAPI AreAllAccessesGranted(DWORD,DWORD); BOOL WINAPI AreAnyAccessesGranted(DWORD,DWORD);
15 years, 10 months
1
0
0
0
[dchapyshev] 39709: - Don't direct call IsUserAnAdmin (setupapi in Windows not linked with shell32) - Implement IsUserAdmin in setupapi (based on shell32 implementation) - Implement pSetupIsUserAdmin
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Feb 22 15:49:18 2009 New Revision: 39709 URL:
http://svn.reactos.org/svn/reactos?rev=39709&view=rev
Log: - Don't direct call IsUserAnAdmin (setupapi in Windows not linked with shell32) - Implement IsUserAdmin in setupapi (based on shell32 implementation) - Implement pSetupIsUserAdmin Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c trunk/reactos/dll/win32/setupapi/misc.c trunk/reactos/dll/win32/setupapi/setupapi.spec Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.…
============================================================================== --- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Sun Feb 22 15:49:18 2009 @@ -153,7 +153,7 @@ if (!PnpGetLocalHandles(&BindingHandle, NULL)) return CR_FAILURE; - bAdmin = IsUserAnAdmin(); + bAdmin = IsUserAdmin(); for (i = 0; i < 30; i++) { @@ -209,7 +209,7 @@ FIXME("%p %p %lu %lx %p\n", plcLogConf, dnDevInst, Priority, ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; if (plcLogConf == NULL) @@ -336,7 +336,7 @@ TRACE("%p %s %lx %p\n", dnDevInst, debugstr_w(pszID), ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; if (dnDevInst == 0) @@ -543,7 +543,7 @@ FIXME("%p %s %p %lx %p\n", pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; if (pdnDevInst == NULL) @@ -713,7 +713,7 @@ FIXME("%p %lx %p\n", dnDevInst, ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; if (dnDevInst == 0) @@ -812,7 +812,7 @@ FIXME("%p %lx %p\n", dnDevInst, ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; if (dnDevInst == 0) @@ -1079,7 +1079,7 @@ TRACE("%lx %lx %lx\n", lcLogConfToBeFreed, ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; pLogConfInfo = (PLOG_CONF_INFO)lcLogConfToBeFreed; @@ -3008,7 +3008,7 @@ FIXME("%lx %lx %lx %lx\n", dnFromDevInst, dnToDevInst, ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; if (dnFromDevInst == 0 || dnToDevInst == 0) @@ -3385,7 +3385,7 @@ TRACE("%lx %lx\n", ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; if (ulFlags & ~CM_DETECT_BITS) @@ -3903,7 +3903,7 @@ FIXME("%lx %lx %lx\n", dnDevInst, ulFlags, hMachine); - if (!IsUserAnAdmin()) + if (!IsUserAdmin()) return CR_ACCESS_DENIED; if (dnDevInst == 0) Modified: trunk/reactos/dll/win32/setupapi/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/misc.c?…
============================================================================== --- trunk/reactos/dll/win32/setupapi/misc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/misc.c [iso-8859-1] Sun Feb 22 15:49:18 2009 @@ -1685,3 +1685,71 @@ { return IsEqualGUID(lpGUID, &GUID_NULL); } + +/* + * implemented + */ +BOOL +WINAPI +IsUserAdmin(VOID) +{ + SID_IDENTIFIER_AUTHORITY Authority = {SECURITY_NT_AUTHORITY}; + HANDLE hToken; + DWORD dwSize; + PTOKEN_GROUPS lpGroups; + PSID lpSid; + DWORD i; + BOOL bResult = FALSE; + + if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) + { + return FALSE; + } + + if (!GetTokenInformation(hToken, TokenGroups, NULL, 0, &dwSize)) + { + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) + { + CloseHandle(hToken); + return FALSE; + } + } + + lpGroups = HeapAlloc(GetProcessHeap(), 0, dwSize); + if (lpGroups == NULL) + { + CloseHandle(hToken); + return FALSE; + } + + if (!GetTokenInformation(hToken, TokenGroups, lpGroups, dwSize, &dwSize)) + { + HeapFree(GetProcessHeap(), 0, lpGroups); + CloseHandle(hToken); + return FALSE; + } + + CloseHandle(hToken); + + if (!AllocateAndInitializeSid(&Authority, 2, SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, + &lpSid)) + { + HeapFree(GetProcessHeap(), 0, lpGroups); + return FALSE; + } + + for (i = 0; i < lpGroups->GroupCount; i++) + { + if (EqualSid(lpSid, lpGroups->Groups[i].Sid)) + { + bResult = TRUE; + break; + } + } + + FreeSid(lpSid); + HeapFree(GetProcessHeap(), 0, lpGroups); + + return bResult; +} Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sun Feb 22 15:49:18 2009 @@ -213,7 +213,7 @@ @ stdcall InstallHinfSection(long long str long) InstallHinfSectionA @ stdcall InstallHinfSectionA(long long str long) @ stdcall InstallHinfSectionW(long long wstr long) -@ stdcall IsUserAdmin() shell32.IsUserAnAdmin +@ stdcall IsUserAdmin() @ stdcall MyFree(ptr) @ stdcall MyMalloc(long) @ stdcall MyRealloc(ptr long) @@ -566,7 +566,7 @@ @ stub pSetupInstallStopEx @ stdcall pSetupIsGuidNull(ptr) @ stub pSetupIsLocalSystem -@ stub pSetupIsUserAdmin +@ stdcall pSetupIsUserAdmin() IsUserAdmin @ stub pSetupMakeSurePathExists @ stub pSetupMalloc @ stub pSetupModifyGlobalFlags
15 years, 10 months
1
0
0
0
[dchapyshev] 39708: - List of exported functions like Win2003 SP1
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Feb 22 15:20:43 2009 New Revision: 39708 URL:
http://svn.reactos.org/svn/reactos?rev=39708&view=rev
Log: - List of exported functions like Win2003 SP1 Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sun Feb 22 15:20:43 2009 @@ -1,8 +1,6 @@ -@ stub AcquireSCMLock -@ stub AddMiniIconToList -@ stub AddTagToGroupOrderListEntry -@ stub AppendStringToMultiSz -@ stdcall AssertFail(str long str) +# Functions exported by Win2003 SP1 +@ stub CMP_GetBlockedDriverInfo +@ stub CMP_GetServerSideDeviceInstallFlags @ stdcall CMP_Init_Detection(long) @ stub CMP_RegisterNotification @ stdcall CMP_Report_LogOn(long long) @@ -53,6 +51,7 @@ @ stub CM_Free_Res_Des @ stub CM_Free_Res_Des_Ex @ stub CM_Free_Res_Des_Handle +@ stub CM_Free_Resource_Conflict_Handle @ stdcall CM_Get_Child(ptr long long) @ stdcall CM_Get_Child_Ex(ptr long long long) @ stdcall CM_Get_Class_Key_NameA(ptr str ptr long) @@ -63,8 +62,14 @@ @ stdcall CM_Get_Class_NameW(ptr wstr ptr long) @ stdcall CM_Get_Class_Name_ExA(ptr str ptr long long) @ stdcall CM_Get_Class_Name_ExW(ptr wstr ptr long long) +@ stub CM_Get_Class_Registry_PropertyA +@ stub CM_Get_Class_Registry_PropertyW @ stdcall CM_Get_Depth(ptr long long) @ stdcall CM_Get_Depth_Ex(ptr long long long) +@ stub CM_Get_DevNode_Custom_PropertyA +@ stub CM_Get_DevNode_Custom_PropertyW +@ stub CM_Get_DevNode_Custom_Property_ExA +@ stub CM_Get_DevNode_Custom_Property_ExW @ stdcall CM_Get_DevNode_Registry_PropertyA(long long ptr ptr ptr long) @ stdcall CM_Get_DevNode_Registry_PropertyW(long long ptr ptr ptr long) @ stdcall CM_Get_DevNode_Registry_Property_ExA(long long ptr ptr ptr long long) @@ -121,6 +126,9 @@ @ stub CM_Get_Res_Des_Data_Ex @ stub CM_Get_Res_Des_Data_Size @ stub CM_Get_Res_Des_Data_Size_Ex +@ stub CM_Get_Resource_Conflict_Count +@ stub CM_Get_Resource_Conflict_DetailsA +@ stub CM_Get_Resource_Conflict_DetailsW @ stdcall CM_Get_Sibling(ptr long long) @ stdcall CM_Get_Sibling_Ex(ptr long long long) @ stdcall CM_Get_Version() @@ -129,6 +137,8 @@ @ stub CM_Invert_Range_List @ stdcall CM_Is_Dock_Station_Present(ptr) @ stdcall CM_Is_Dock_Station_Present_Ex(ptr long) +@ stub CM_Is_Version_Available +@ stub CM_Is_Version_Available_Ex @ stdcall CM_Locate_DevNodeA(ptr str long) @ stdcall CM_Locate_DevNodeW(ptr wstr long) @ stdcall CM_Locate_DevNode_ExA(ptr str long long) @@ -145,12 +155,17 @@ @ stdcall CM_Open_Class_Key_ExW(ptr wstr long long ptr long long) @ stdcall CM_Open_DevNode_Key(ptr long long long ptr long) @ stdcall CM_Open_DevNode_Key_Ex(ptr long long long ptr long long) +@ stub CM_Query_And_Remove_SubTreeA +@ stub CM_Query_And_Remove_SubTreeW +@ stub CM_Query_And_Remove_SubTree_ExA +@ stub CM_Query_And_Remove_SubTree_ExW @ stub CM_Query_Arbitrator_Free_Data @ stub CM_Query_Arbitrator_Free_Data_Ex @ stub CM_Query_Arbitrator_Free_Size @ stub CM_Query_Arbitrator_Free_Size_Ex @ stub CM_Query_Remove_SubTree @ stub CM_Query_Remove_SubTree_Ex +@ stub CM_Query_Resource_Conflict_List @ stdcall CM_Reenumerate_DevNode(long long) @ stdcall CM_Reenumerate_DevNode_Ex(long long long) @ stub CM_Register_Device_Driver @@ -161,16 +176,16 @@ @ stub CM_Register_Device_Interface_ExW @ stub CM_Remove_SubTree @ stub CM_Remove_SubTree_Ex -@ stub CM_Remove_Unmarked_Children -@ stub CM_Remove_Unmarked_Children_Ex @ stub CM_Request_Device_EjectA @ stub CM_Request_Device_EjectW +@ stub CM_Request_Device_Eject_ExA +@ stub CM_Request_Device_Eject_ExW @ stdcall CM_Request_Eject_PC() @ stdcall CM_Request_Eject_PC_Ex(long) -@ stub CM_Reset_Children_Marks -@ stub CM_Reset_Children_Marks_Ex @ stdcall CM_Run_Detection(long) @ stdcall CM_Run_Detection_Ex(long long) +@ stub CM_Set_Class_Registry_PropertyA +@ stub CM_Set_Class_Registry_PropertyW @ stdcall CM_Set_DevNode_Problem(long long long) @ stdcall CM_Set_DevNode_Problem_Ex(long long long long) @ stdcall CM_Set_DevNode_Registry_PropertyA(long long ptr long long) @@ -192,50 +207,16 @@ @ stub CM_Unregister_Device_InterfaceW @ stub CM_Unregister_Device_Interface_ExA @ stub CM_Unregister_Device_Interface_ExW -@ stdcall CaptureAndConvertAnsiArg(str ptr) -@ stdcall CaptureStringArg(wstr ptr) -@ stdcall CenterWindowRelativeToParent(long) -@ stdcall ConcatenatePaths(wstr wstr long ptr) -@ stdcall DelayedMove(wstr wstr) -@ stub DelimStringToMultiSz -@ stub DestroyTextFileReadBuffer @ stdcall DoesUserHavePrivilege(wstr) -@ stdcall DuplicateString(wstr) -@ stdcall EnablePrivilege(wstr long) @ stub ExtensionPropSheetPageProc -@ stdcall FileExists(wstr ptr) -@ stub FreeStringArray -@ stub GetCurrentDriverSigningPolicy -@ stub GetNewInfName -@ stdcall GetSetFileTimestamp(wstr ptr ptr ptr long) -@ stdcall GetVersionInfoFromImage(wstr ptr ptr) -@ stub InfIsFromOemLocation @ stdcall InstallCatalog(str str ptr) @ stdcall InstallHinfSection(long long str long) InstallHinfSectionA @ stdcall InstallHinfSectionA(long long str long) @ stdcall InstallHinfSectionW(long long wstr long) -@ stub InstallStop -@ stub InstallStopEx @ stdcall IsUserAdmin() shell32.IsUserAnAdmin -@ stub LookUpStringInTable -@ stub MemoryInitialize -@ stdcall MultiByteToUnicode(str long) -@ stub MultiSzFromSearchControl @ stdcall MyFree(ptr) -@ stdcall MyGetFileTitle(wstr) @ stdcall MyMalloc(long) @ stdcall MyRealloc(ptr long) -@ stdcall OpenAndMapFileForRead(wstr ptr ptr ptr ptr) -@ stub OutOfMemory -@ stub QueryMultiSzValueToArray -@ stdcall QueryRegistryValue(long wstr ptr ptr ptr) -@ stub ReadAsciiOrUnicodeTextFile -@ stdcall RegistryDelnode(long long) -# Yes, Microsoft really misspelled this one! -@ stdcall RetreiveFileSecurity(wstr ptr) -@ stub RetrieveServiceConfig -@ stub SearchForInfFile -@ stub SetArrayToMultiSzValue @ stdcall SetupAddInstallSectionToDiskSpaceListA(long long long str ptr long) @ stub SetupAddInstallSectionToDiskSpaceListW @ stub SetupAddSectionToDiskSpaceListA @@ -246,12 +227,17 @@ @ stub SetupAddToSourceListW @ stub SetupAdjustDiskSpaceListA @ stub SetupAdjustDiskSpaceListW +@ stub SetupBackupErrorA +@ stub SetupBackupErrorW @ stub SetupCancelTemporarySourceList @ stdcall SetupCloseFileQueue(ptr) @ stdcall SetupCloseInfFile(long) @ stdcall SetupCloseLog() +@ stdcall SetupCommitFileQueue(long long ptr ptr) SetupCommitFileQueueA @ stdcall SetupCommitFileQueueA(long long ptr ptr) @ stdcall SetupCommitFileQueueW(long long ptr ptr) +@ stub SetupConfigureWmiFromInfSectionA +@ stub SetupConfigureWmiFromInfSectionW @ stdcall SetupCopyErrorA(long str str str str str long long str long ptr) @ stdcall SetupCopyErrorW(long wstr wstr wstr wstr wstr long long wstr long ptr) @ stdcall SetupCopyOEMInfA(str str long long ptr long ptr ptr) @@ -260,7 +246,7 @@ @ stdcall SetupCreateDiskSpaceListW(ptr long long) @ stdcall SetupDecompressOrCopyFileA(str str ptr) @ stdcall SetupDecompressOrCopyFileW(wstr wstr ptr) -@ stub SetupDefaultQueueCallback +@ stdcall SetupDefaultQueueCallback(ptr long long long) SetupDefaultQueueCallbackA @ stdcall SetupDefaultQueueCallbackA(ptr long long long) @ stdcall SetupDefaultQueueCallbackW(ptr long long long) @ stdcall SetupDeleteErrorA(long str str long long) @@ -290,9 +276,9 @@ @ stdcall SetupDiCreateDeviceInfoListExW(ptr long wstr ptr) @ stdcall SetupDiCreateDeviceInfoW(ptr wstr ptr wstr ptr long ptr) @ stdcall SetupDiCreateDeviceInterfaceA(ptr ptr ptr str long ptr) -@ stdcall SetupDiCreateDeviceInterfaceW(ptr ptr ptr wstr long ptr) @ stdcall SetupDiCreateDeviceInterfaceRegKeyA(ptr ptr long long ptr ptr) @ stdcall SetupDiCreateDeviceInterfaceRegKeyW(ptr ptr long long ptr ptr) +@ stdcall SetupDiCreateDeviceInterfaceW(ptr ptr ptr wstr long ptr) @ stdcall SetupDiDeleteDevRegKey(ptr ptr long long long) @ stdcall SetupDiDeleteDeviceInfo(long ptr) @ stub SetupDiDeleteDeviceInterfaceData @@ -305,6 +291,8 @@ @ stdcall SetupDiEnumDeviceInterfaces(long ptr ptr long ptr) @ stdcall SetupDiEnumDriverInfoA(long ptr long long ptr) @ stdcall SetupDiEnumDriverInfoW(long ptr long long ptr) +@ stub SetupDiGetActualModelsSectionA +@ stub SetupDiGetActualModelsSectionW @ stdcall SetupDiGetActualSectionToInstallA(long str str long ptr ptr) @ stdcall SetupDiGetActualSectionToInstallExA(long str ptr str long ptr ptr ptr) @ stdcall SetupDiGetActualSectionToInstallExW(long wstr ptr wstr long ptr ptr ptr) @@ -326,6 +314,10 @@ @ stdcall SetupDiGetClassImageListExW(ptr wstr ptr) @ stdcall SetupDiGetClassInstallParamsA(ptr ptr ptr long ptr) @ stdcall SetupDiGetClassInstallParamsW(ptr ptr ptr long ptr) +@ stub SetupDiGetClassRegistryPropertyA +@ stub SetupDiGetClassRegistryPropertyW +@ stub SetupDiGetCustomDevicePropertyA +@ stub SetupDiGetCustomDevicePropertyW @ stdcall SetupDiGetDeviceInfoListClass(ptr ptr) @ stdcall SetupDiGetDeviceInfoListDetailA(ptr ptr) @ stdcall SetupDiGetDeviceInfoListDetailW(ptr ptr) @@ -377,13 +369,17 @@ @ stdcall SetupDiRegisterDeviceInfo(ptr ptr long ptr ptr ptr) @ stdcall SetupDiRemoveDevice(ptr ptr) @ stub SetupDiRemoveDeviceInterface +@ stub SetupDiRestartDevices @ stdcall SetupDiSelectBestCompatDrv(ptr ptr) @ stdcall SetupDiSelectDevice(ptr ptr) @ stub SetupDiSelectOEMDrv @ stdcall SetupDiSetClassInstallParamsA(ptr ptr ptr long) @ stdcall SetupDiSetClassInstallParamsW(ptr ptr ptr long) +@ stub SetupDiSetClassRegistryPropertyA +@ stub SetupDiSetClassRegistryPropertyW @ stdcall SetupDiSetDeviceInstallParamsA(ptr ptr ptr) @ stdcall SetupDiSetDeviceInstallParamsW(ptr ptr ptr) +@ stub SetupDiSetDeviceInterfaceDefault @ stdcall SetupDiSetDeviceRegistryPropertyA(ptr ptr long ptr long) @ stdcall SetupDiSetDeviceRegistryPropertyW(ptr ptr long ptr long) @ stub SetupDiSetDriverInstallParamsA @@ -394,6 +390,8 @@ @ stdcall SetupDiUnremoveDevice(ptr ptr) @ stub SetupDuplicateDiskSpaceListA @ stub SetupDuplicateDiskSpaceListW +@ stub SetupEnumInfSectionsA +@ stub SetupEnumInfSectionsW @ stdcall SetupFindFirstLineA(long str str ptr) @ stdcall SetupFindFirstLineW(long wstr wstr ptr) @ stdcall SetupFindNextLine(ptr ptr) @@ -425,6 +423,7 @@ @ stdcall SetupGetLineTextW(ptr long wstr wstr ptr long ptr) @ stdcall SetupGetMultiSzFieldA(ptr long ptr long ptr) @ stdcall SetupGetMultiSzFieldW(ptr long ptr long ptr) +@ stub SetupGetNonInteractiveMode @ stdcall SetupGetSourceFileLocationA(ptr ptr str ptr ptr long ptr) @ stdcall SetupGetSourceFileLocationW(ptr ptr wstr ptr ptr long ptr) @ stub SetupGetSourceFileSizeA @@ -464,6 +463,8 @@ @ stdcall SetupOpenInfFileW(wstr wstr long ptr) @ stdcall SetupOpenLog(long) @ stdcall SetupOpenMasterInf() +@ stub SetupPrepareQueueForRestoreA +@ stub SetupPrepareQueueForRestoreW @ stdcall SetupPromptForDiskA(ptr str str str str str long ptr long ptr) @ stdcall SetupPromptForDiskW(ptr wstr wstr wstr wstr wstr long ptr long ptr) @ stdcall SetupPromptReboot(ptr ptr long) @@ -509,7 +510,7 @@ @ stub SetupRemoveSectionFromDiskSpaceListW @ stdcall SetupRenameErrorA(long str str str long long) @ stdcall SetupRenameErrorW(long wstr wstr wstr long long) -@ stub SetupScanFileQueue +@ stdcall SetupScanFileQueue(long long long ptr ptr ptr) SetupScanFileQueueA @ stdcall SetupScanFileQueueA(long long long ptr ptr ptr) @ stdcall SetupScanFileQueueW(long long long ptr ptr ptr) @ stdcall SetupSetDirectoryIdA(long long str) @@ -519,49 +520,117 @@ @ stdcall SetupSetFileQueueAlternatePlatformA(ptr ptr str) @ stdcall SetupSetFileQueueAlternatePlatformW(ptr ptr wstr) @ stdcall SetupSetFileQueueFlags(long long long) +@ stub SetupSetNonInteractiveMode @ stub SetupSetPlatformPathOverrideA @ stub SetupSetPlatformPathOverrideW @ stdcall SetupSetSourceListA(long ptr long) @ stdcall SetupSetSourceListW(long ptr long) @ stdcall SetupTermDefaultQueueCallback(ptr) @ stdcall SetupTerminateFileLog(long) -@ stub ShouldDeviceBeExcluded -@ stdcall StampFileSecurity(wstr ptr) -@ stdcall StringTableAddString(ptr wstr long) -@ stdcall StringTableAddStringEx(ptr wstr long ptr long) -@ stdcall StringTableDestroy(ptr) -@ stdcall StringTableDuplicate(ptr) -@ stub StringTableEnum -@ stdcall StringTableGetExtraData(ptr long ptr long) -@ stdcall StringTableInitialize() -@ stdcall StringTableInitializeEx(long long) -@ stdcall StringTableLookUpString(ptr wstr long) -@ stdcall StringTableLookUpStringEx(ptr wstr long ptr ptr) -@ stdcall StringTableSetExtraData(ptr long ptr long) -@ stdcall StringTableStringFromId(ptr long) -@ stdcall StringTableStringFromIdEx(ptr long ptr ptr) -@ stdcall StringTableTrim(ptr) -@ stdcall TakeOwnershipOfFile(wstr) +@ stub SetupUninstallNewlyCopiedInfs +@ stub SetupUninstallOEMInfA +@ stub SetupUninstallOEMInfW +@ stub SetupVerifyInfFileA +@ stub SetupVerifyInfFileW @ stdcall UnicodeToMultiByte(wstr long) -@ stdcall UnmapAndCloseFile(long long ptr) @ stub VerifyCatalogFile -@ stub VerifyFile @ stub pSetupAccessRunOnceNodeList +@ stub pSetupAcquireSCMLock @ stub pSetupAddMiniIconToList @ stub pSetupAddTagToGroupOrderListEntry @ stub pSetupAppendStringToMultiSz +@ stdcall pSetupCaptureAndConvertAnsiArg(str ptr) CaptureAndConvertAnsiArg +@ stdcall pSetupCenterWindowRelativeToParent(long) CenterWindowRelativeToParent +@ stdcall pSetupConcatenatePaths(wstr wstr long ptr) ConcatenatePaths @ stub pSetupDestroyRunOnceNodeList +@ stub pSetupDiGetDeviceInfoContext +@ stub pSetupDiSetDeviceInfoContext +@ stub pSetupDoesUserHavePrivilege +@ stdcall pSetupDuplicateString(wstr) DuplicateString +@ stdcall pSetupEnablePrivilege(wstr long) EnablePrivilege +@ stub pSetupFree +@ stub pSetupFreeStringArray +@ stub pSetupGetCurrentDriverSigningPolicy +@ stdcall pSetupGetField(ptr long) +@ stub pSetupGetFileTitle +@ stdcall pSetupGetGlobalFlags() +@ stub pSetupGetInfSections +@ stdcall pSetupGetQueueFlags(ptr) +@ stub pSetupGetRealSystemTime +@ stdcall pSetupGetVersionInfoFromImage(wstr ptr ptr) GetVersionInfoFromImage +@ stdcall pSetupGuidFromString(wstr ptr) +@ stub pSetupHandleFailedVerification +@ stub pSetupInfCacheBuild +@ stub pSetupInfIsFromOemLocation +@ stub pSetupInstallCatalog +@ stub pSetupInstallStopEx +@ stdcall pSetupIsGuidNull(ptr) +@ stub pSetupIsLocalSystem +@ stub pSetupIsUserAdmin +@ stub pSetupMakeSurePathExists +@ stub pSetupMalloc +@ stub pSetupModifyGlobalFlags +@ stdcall pSetupMultiByteToUnicode(str long) MultiByteToUnicode +@ stdcall pSetupOpenAndMapFileForRead(wstr ptr ptr ptr ptr) OpenAndMapFileForRead +@ stub pSetupOutOfMemory +@ stub pSetupQueryMultiSzValueToArray +@ stub pSetupRealloc +@ stdcall pSetupRegistryDelnode(long long) RegistryDelnode +@ stub pSetupRetrieveServiceConfig +@ stub pSetupSetArrayToMultiSzValue +@ stdcall pSetupSetGlobalFlags(long) +@ stub pSetupSetNoDriverPrompts +@ stdcall pSetupSetQueueFlags(ptr long) +@ stub pSetupSetSystemSourcePath +@ stub pSetupShouldDeviceBeExcluded +@ stdcall pSetupStringFromGuid(ptr wstr long) +@ stdcall pSetupStringTableAddString(ptr wstr long) StringTableAddString +@ stdcall pSetupStringTableAddStringEx(ptr wstr long ptr long) StringTableAddStringEx +@ stdcall pSetupStringTableDestroy(ptr) StringTableDestroy +@ stdcall pSetupStringTableDuplicate(ptr) StringTableDuplicate +@ stub pSetupStringTableEnum +@ stdcall pSetupStringTableGetExtraData(ptr long ptr long) StringTableGetExtraData +@ stdcall pSetupStringTableInitialize() StringTableInitialize +@ stdcall pSetupStringTableInitializeEx(long long) StringTableInitializeEx +@ stdcall pSetupStringTableLookUpString(ptr wstr long) StringTableLookUpString +@ stdcall pSetupStringTableLookUpStringEx(ptr wstr long ptr ptr) StringTableLookUpStringEx +@ stdcall pSetupStringTableSetExtraData(ptr long ptr long) StringTableSetExtraData +@ stdcall pSetupStringTableStringFromId(ptr long) StringTableStringFromId +@ stdcall pSetupStringTableStringFromIdEx(ptr long ptr ptr) StringTableStringFromIdEx +@ stdcall pSetupUnicodeToMultiByte(wstr long) UnicodeToMultiByte +@ stdcall pSetupUnmapAndCloseFile(long long ptr) UnmapAndCloseFile +@ stub pSetupVerifyCatalogFile +@ stub pSetupVerifyFile +@ stub pSetupVerifyQueuedCatalogs +@ stub pSetupWriteLogEntry +@ stub pSetupWriteLogError + +# Unknown functions, they are not present in Win2003 SP1 +@ stdcall AssertFail(str long str) +@ stub CM_Remove_Unmarked_Children +@ stub CM_Remove_Unmarked_Children_Ex +@ stub CM_Reset_Children_Marks +@ stub CM_Reset_Children_Marks_Ex +@ stdcall CaptureStringArg(wstr ptr) +@ stdcall DelayedMove(wstr wstr) +@ stub DelimStringToMultiSz +@ stub DestroyTextFileReadBuffer +@ stdcall FileExists(wstr ptr) +@ stub GetNewInfName +@ stdcall GetSetFileTimestamp(wstr ptr ptr ptr long) +@ stub LookUpStringInTable +@ stub MemoryInitialize +@ stub MultiSzFromSearchControl +@ stdcall MyGetFileTitle(wstr) +@ stdcall QueryRegistryValue(long wstr ptr ptr ptr) +@ stub ReadAsciiOrUnicodeTextFile +# Yes, Microsoft really misspelled this one! +@ stdcall RetreiveFileSecurity(wstr ptr) +@ stub SearchForInfFile +@ stdcall StampFileSecurity(wstr ptr) +@ stdcall StringTableTrim(ptr) +@ stdcall TakeOwnershipOfFile(wstr) @ stub pSetupDirectoryIdToPath -@ stdcall pSetupGetField(ptr long) -@ stdcall pSetupGetGlobalFlags() @ stub pSetupGetOsLoaderDriveAndPath -@ stdcall pSetupGetQueueFlags(ptr) @ stub pSetupGetVersionDatum -@ stdcall pSetupGuidFromString(wstr ptr) -@ stdcall pSetupIsGuidNull(ptr) -@ stub pSetupMakeSurePathExists -@ stdcall pSetupSetGlobalFlags(long) -@ stdcall pSetupSetQueueFlags(ptr long) @ stub pSetupSetSystemSourceFlags -@ stdcall pSetupStringFromGuid(ptr wstr long) -@ stub pSetupVerifyQueuedCatalogs
15 years, 10 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
56
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
Results per page:
10
25
50
100
200