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
January 2011
----- 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
20 participants
336 discussions
Start a n
N
ew thread
[akhaldi] 50534: [CMAKE] - Share freeldr_arch as a static lib between freeldr and setupldr. - Some formatting fixes.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 28 11:40:45 2011 New Revision: 50534 URL:
http://svn.reactos.org/svn/reactos?rev=50534&view=rev
Log: [CMAKE] - Share freeldr_arch as a static lib between freeldr and setupldr. - Some formatting fixes. Modified: branches/cmake-bringup/boot/freeldr/freeldr/CMakeLists.txt Modified: branches/cmake-bringup/boot/freeldr/freeldr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/boot/freeldr/free…
============================================================================== --- branches/cmake-bringup/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Fri Jan 28 11:40:45 2011 @@ -9,44 +9,42 @@ endif() if(ARCH MATCHES i386) -if(MSVC) -list(APPEND FREELDR_BASE64K_SOURCE - arch/i386/realmode.S) -else() -list(APPEND FREELDR_STARTUP_SOURCE - arch/i386/fathelp.S - arch/i386/arch.S) -endif() + if(MSVC) + list(APPEND FREELDR_BASE64K_SOURCE + arch/i386/realmode.S) + else() + list(APPEND FREELDR_STARTUP_SOURCE + arch/i386/fathelp.S + arch/i386/arch.S) + endif() elseif(ARCH MATCHES amd64) -list(APPEND FREELDR_STARTUP_SOURCE - arch/i386/fathelp.S - arch/amd64/arch.S) -endif(ARCH MATCHES i386) - -if(ARCH MATCHES i386) -if(NOT MSVC) -list(APPEND FREELDR_BASE64K_SOURCE - arch/i386/boot.S - arch/i386/drvmap.S - arch/i386/i386cpu.S - arch/i386/i386idt.S - arch/i386/i386pnp.S - arch/i386/i386trap.S - arch/i386/int386.S - arch/i386/linux.S - arch/i386/mb.S - arch/i386/i386bug.c) -endif() + list(APPEND FREELDR_STARTUP_SOURCE + arch/i386/fathelp.S + arch/amd64/arch.S) +endif() + +if(ARCH MATCHES i386) + if(NOT MSVC) + list(APPEND FREELDR_BASE64K_SOURCE + arch/i386/boot.S + arch/i386/drvmap.S + arch/i386/i386cpu.S + arch/i386/i386idt.S + arch/i386/i386pnp.S + arch/i386/i386trap.S + arch/i386/int386.S + arch/i386/linux.S + arch/i386/mb.S + arch/i386/i386bug.c) + endif() elseif(ARCH MATCHES amd64) -list(APPEND FREELDR_BASE64K_SOURCE - arch/i386/drvmap.S - arch/i386/i386cpu.S - arch/i386/i386idt.S - arch/i386/i386trap.S - arch/amd64/mb.S) -endif(ARCH MATCHES i386) - - + list(APPEND FREELDR_BASE64K_SOURCE + arch/i386/drvmap.S + arch/i386/i386cpu.S + arch/i386/i386idt.S + arch/i386/i386trap.S + arch/amd64/mb.S) +endif() set_source_files_properties(${FREELDR_BASE64K_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_NTHAL_") @@ -105,10 +103,10 @@ oslist.c) if(ARCH MATCHES i386) -list(APPEND FREELDR_BASE_SOURCE - windows/headless.c - disk/scsiport.c) -endif(ARCH MATCHES i386) + list(APPEND FREELDR_BASE_SOURCE + windows/headless.c + disk/scsiport.c) +endif() set_source_files_properties(${FREELDR_BASE_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_NTHAL_;_BLDR_;_NTSYSTEM_") @@ -116,75 +114,61 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/elf) if(ARCH MATCHES i386) -list(APPEND FREELDR_ARCH_SOURCE - arch/i386/archmach.c - arch/i386/custom.c - arch/i386/drivemap.c - arch/i386/halstub.c - arch/i386/hardware.c - arch/i386/hwacpi.c - arch/i386/hwapm.c - arch/i386/hwpci.c - arch/i386/i386disk.c - arch/i386/i386rtl.c - arch/i386/i386vid.c - arch/i386/loader.c - arch/i386/machpc.c - arch/i386/miscboot.c - arch/i386/ntoskrnl.c - arch/i386/pccons.c - arch/i386/pcdisk.c - arch/i386/pcmem.c - arch/i386/pcrtc.c - arch/i386/pcvideo.c - arch/i386/machxbox.c - arch/i386/xboxcons.c - arch/i386/xboxdisk.c - arch/i386/xboxfont.c - arch/i386/xboxhw.c - arch/i386/xboxi2c.c - arch/i386/xboxmem.c - arch/i386/xboxrtc.c - arch/i386/xboxvideo.c - windows/i386/ntsetup.c - windows/i386/wlmemory.c) + list(APPEND FREELDR_ARCH_SOURCE + arch/i386/archmach.c + arch/i386/custom.c + arch/i386/drivemap.c + arch/i386/halstub.c + arch/i386/hardware.c + arch/i386/hwacpi.c + arch/i386/hwapm.c + arch/i386/hwpci.c + arch/i386/i386disk.c + arch/i386/i386rtl.c + arch/i386/i386vid.c + arch/i386/loader.c + arch/i386/machpc.c + arch/i386/miscboot.c + arch/i386/ntoskrnl.c + arch/i386/pccons.c + arch/i386/pcdisk.c + arch/i386/pcmem.c + arch/i386/pcrtc.c + arch/i386/pcvideo.c + arch/i386/machxbox.c + arch/i386/xboxcons.c + arch/i386/xboxdisk.c + arch/i386/xboxfont.c + arch/i386/xboxhw.c + arch/i386/xboxi2c.c + arch/i386/xboxmem.c + arch/i386/xboxrtc.c + arch/i386/xboxvideo.c + windows/i386/ntsetup.c + windows/i386/wlmemory.c) else() #TBD -endif(ARCH MATCHES i386) +endif() set_source_files_properties(${FREELDR_ARCH_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_NTHAL_;_BLDR_;_NTSYSTEM_") - -list(APPEND SETUPLDR_MAIN_SOURCE - bootmgr.c - inffile/inffile.c - reactos/setupldr.c) - -if(ARCH MATCHES i386) -list(APPEND SETUPLDR_MAIN_SOURCE windows/setupldr2.c) -elseif(ARCH MATCHES amd64) -list(APPEND SETUPLDR_MAIN_SOURCE windows/setupldr2.c) -endif(ARCH MATCHES i386) - -set_source_files_properties(${SETUPLDR_MAIN_SOURCE} PROPERTIES COMPILE_FLAGS "-ffreestanding -fno-builtin -fno-inline -fno-zero-initialized-in-bss") - - +add_library(freeldr_arch ${FREELDR_ARCH_SOURCE}) list(APPEND FREELDR_SOURCE bootmgr.c ${FREELDR_STARTUP_SOURCE} ${FREELDR_BASE64K_SOURCE} ${FREELDR_BASE_SOURCE} - ${FREELDR_ARCH_SOURCE}) + ) add_library(freeldr SHARED ${CMAKE_CURRENT_BINARY_DIR}/freeldr_freeldr.h.gch ${FREELDR_SOURCE}) if(NOT MSVC) -set_target_properties(freeldr PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk" SUFFIX ".sys") + set_target_properties(freeldr PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk" SUFFIX ".sys") set_image_base(freeldr 0x8000) else() -set_target_properties(freeldr PROPERTIES LINK_FLAGS "/DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION" SUFFIX ".sys") + set_target_properties(freeldr PROPERTIES LINK_FLAGS "/DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION" SUFFIX ".sys") set_image_base(freeldr 0x10000) endif() @@ -192,42 +176,55 @@ set_entrypoint(freeldr mainCRTStartup) if(ARCH MATCHES i386) -target_link_libraries(freeldr mini_hal) -endif(ARCH MATCHES i386) + target_link_libraries(freeldr mini_hal) +endif() target_link_libraries(freeldr + freeldr_arch cportlib rossym cmlib rtl libcntpr) + add_pch(freeldr ${CMAKE_CURRENT_SOURCE_DIR}/include/freeldr.h ${FREELDR_SOURCE}) add_dependencies(freeldr asm) + +list(APPEND SETUPLDR_MAIN_SOURCE + bootmgr.c + inffile/inffile.c + reactos/setupldr.c) + +if(ARCH MATCHES i386 OR ARCH MATCHES amd64) + list(APPEND SETUPLDR_MAIN_SOURCE windows/setupldr2.c) +endif() + +set_source_files_properties(${SETUPLDR_MAIN_SOURCE} PROPERTIES COMPILE_FLAGS "-ffreestanding -fno-builtin -fno-inline -fno-zero-initialized-in-bss") list(APPEND SETUPLDR_SOURCE ${FREELDR_STARTUP_SOURCE} ${FREELDR_BASE64K_SOURCE} ${FREELDR_BASE_SOURCE} - ${FREELDR_ARCH_SOURCE} ${SETUPLDR_MAIN_SOURCE}) add_library(setupldr SHARED ${SETUPLDR_SOURCE}) if(NOT MSVC) -set_target_properties(setupldr PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk" SUFFIX ".sys" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP") + set_target_properties(setupldr PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk" SUFFIX ".sys" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP") set_image_base(setupldr 0x8000) else() -set_target_properties(setupldr PROPERTIES LINK_FLAGS "/DRIVER /SECTION:.text,ERWP,ALIGN=0x1000" SUFFIX ".sys" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP") + set_target_properties(setupldr PROPERTIES LINK_FLAGS "/DRIVER /SECTION:.text,ERWP,ALIGN=0x1000" SUFFIX ".sys" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP") endif() set_subsystem(setupldr native) set_entrypoint(setupldr mainCRTStartup) if(ARCH MATCHES i386) -target_link_libraries(setupldr mini_hal) -endif(ARCH MATCHES i386) + target_link_libraries(setupldr mini_hal) +endif() target_link_libraries(setupldr + freeldr_arch cportlib rossym cmlib @@ -239,4 +236,4 @@ # Bootcd files add_minicd_target(setupldr loader setupldr.sys) add_minicd_target(freeldr loader freeldr.sys) -add_livecd_target(setupldr loader) +add_livecd_target(setupldr loader)
13 years, 11 months
1
0
0
0
[akhaldi] 50533: [CMAKE] - Properly handle setting the suffix variable. Fixes import libs creation.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 28 11:25:24 2011 New Revision: 50533 URL:
http://svn.reactos.org/svn/reactos?rev=50533&view=rev
Log: [CMAKE] - Properly handle setting the suffix variable. Fixes import libs creation. Modified: branches/cmake-bringup/gcc.cmake branches/cmake-bringup/msc.cmake Modified: branches/cmake-bringup/gcc.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=505…
============================================================================== --- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Fri Jan 28 11:25:24 2011 @@ -269,6 +269,14 @@ get_filename_component(_name ${_exports_file} NAME_WE) get_filename_component(_extension ${_exports_file} EXT) get_target_property(_suffix ${_name} SUFFIX) + if(${_suffix} STREQUAL "_suffix-NOTFOUND") + get_target_property(_type ${_name} TYPE) + if(${_type} MATCHES EXECUTABLE) + set(_suffix ".exe") + else() + set(_suffix ".dll") + endif() + endif() if (${_extension} STREQUAL ".spec") Modified: branches/cmake-bringup/msc.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=505…
============================================================================== --- branches/cmake-bringup/msc.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/msc.cmake [iso-8859-1] Fri Jan 28 11:25:24 2011 @@ -139,6 +139,14 @@ macro(add_importlib_target _exports_file) get_filename_component(_name ${_exports_file} NAME_WE) get_target_property(_suffix ${_name} SUFFIX) + if(${_suffix} STREQUAL "_suffix-NOTFOUND") + get_target_property(_type ${_name} TYPE) + if(${_type} MATCHES EXECUTABLE) + set(_suffix ".exe") + else() + set(_suffix ".dll") + endif() + endif() # Generate the asm stub file and the export def file add_custom_command(
13 years, 11 months
1
0
0
0
[janderwald] 50532: [WDMAUD.DRV] - Merge from audio branch - Fix build [WDMAUD_KERNEL] - Fix build - Update to new mmixer library interface
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 28 11:23:37 2011 New Revision: 50532 URL:
http://svn.reactos.org/svn/reactos?rev=50532&view=rev
Log: [WDMAUD.DRV] - Merge from audio branch - Fix build [WDMAUD_KERNEL] - Fix build - Update to new mmixer library interface Modified: trunk/reactos/dll/win32/wdmaud.drv/legacy.c trunk/reactos/dll/win32/wdmaud.drv/mmixer.c trunk/reactos/dll/win32/wdmaud.drv/wdmaud.h trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c trunk/reactos/include/reactos/libs/sound/mmebuddy.h Modified: trunk/reactos/dll/win32/wdmaud.drv/legacy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/legac…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/legacy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/legacy.c [iso-8859-1] Fri Jan 28 11:23:37 2011 @@ -800,6 +800,7 @@ MMRESULT WdmAudQueryMixerInfoByLegacy( IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN DWORD DeviceId, IN UINT uMsg, IN LPVOID Parameter, IN DWORD Flags) @@ -819,6 +820,7 @@ ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); DeviceInfo.hDevice = Handle; + DeviceInfo.DeviceIndex = DeviceId; DeviceInfo.DeviceType = MIXER_DEVICE_TYPE; DeviceInfo.Flags = Flags; Modified: trunk/reactos/dll/win32/wdmaud.drv/mmixer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/mmixe…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/mmixer.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/mmixer.c [iso-8859-1] Fri Jan 28 11:23:37 2011 @@ -8,6 +8,18 @@ */ #include "wdmaud.h" + +typedef struct +{ + KSSTREAM_HEADER Header; + HANDLE hDevice; + PSOUND_OVERLAPPED Overlap; + LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine; + DWORD IoCtl; +}IO_PACKET, *LPIO_PACKET; + +BOOL MMixerLibraryInitialized = FALSE; + PVOID Alloc(ULONG NumBytes); @@ -110,7 +122,7 @@ VOID Copy(PVOID Src, PVOID Dst, ULONG NumBytes) { - CopyMemory(Src, Dst, NumBytes); + RtlMoveMemory(Src, Dst, NumBytes); } MIXER_STATUS @@ -282,7 +294,6 @@ HeapFree(GetProcessHeap(), 0, DetailData); return MM_STATUS_NO_MEMORY; } - DPRINT1("DeviceName %S\n", DetailData->DevicePath); wcscpy(*DeviceName, DetailData->DevicePath); HeapFree(GetProcessHeap(), 0, DetailData); @@ -323,6 +334,13 @@ { HDEVINFO DeviceHandle; MIXER_STATUS Status; + + if (MMixerLibraryInitialized) + { + /* library is already initialized */ + return TRUE; + } + /* create a device list */ DeviceHandle = SetupDiGetClassDevs(&CategoryGuid, @@ -350,6 +368,9 @@ return FALSE; } + /* library is now initialized */ + MMixerLibraryInitialized = TRUE; + /* completed successfully */ return TRUE; } @@ -363,7 +384,7 @@ MMRESULT WdmAudGetMixerCapabilties( - IN ULONG DeviceId, + IN ULONG DeviceId, LPMIXERCAPSW Capabilities) { if (MMixerGetCapabilities(&MixerContext, DeviceId, Capabilities) == MM_STATUS_SUCCESS) @@ -375,10 +396,11 @@ MMRESULT WdmAudGetLineInfo( IN HANDLE hMixer, + IN DWORD MixerId, IN LPMIXERLINEW MixLine, IN ULONG Flags) { - if (MMixerGetLineInfo(&MixerContext, hMixer, Flags, MixLine) == MM_STATUS_SUCCESS) + if (MMixerGetLineInfo(&MixerContext, hMixer, MixerId, Flags, MixLine) == MM_STATUS_SUCCESS) return MMSYSERR_NOERROR; return MMSYSERR_ERROR; @@ -387,10 +409,11 @@ MMRESULT WdmAudGetLineControls( IN HANDLE hMixer, + IN DWORD MixerId, IN LPMIXERLINECONTROLSW MixControls, IN ULONG Flags) { - if (MMixerGetLineControls(&MixerContext, hMixer, Flags, MixControls) == MM_STATUS_SUCCESS) + if (MMixerGetLineControls(&MixerContext, hMixer, MixerId, Flags, MixControls) == MM_STATUS_SUCCESS) return MMSYSERR_NOERROR; return MMSYSERR_ERROR; @@ -399,10 +422,11 @@ MMRESULT WdmAudSetControlDetails( IN HANDLE hMixer, + IN DWORD MixerId, IN LPMIXERCONTROLDETAILS MixDetails, IN ULONG Flags) { - if (MMixerSetControlDetails(&MixerContext, hMixer, Flags, MixDetails) == MM_STATUS_SUCCESS) + if (MMixerSetControlDetails(&MixerContext, hMixer, MixerId, Flags, MixDetails) == MM_STATUS_SUCCESS) return MMSYSERR_NOERROR; return MMSYSERR_ERROR; @@ -412,10 +436,11 @@ MMRESULT WdmAudGetControlDetails( IN HANDLE hMixer, + IN DWORD MixerId, IN LPMIXERCONTROLDETAILS MixDetails, IN ULONG Flags) { - if (MMixerGetControlDetails(&MixerContext, hMixer, Flags, MixDetails) == MM_STATUS_SUCCESS) + if (MMixerGetControlDetails(&MixerContext, hMixer, MixerId, Flags, MixDetails) == MM_STATUS_SUCCESS) return MMSYSERR_NOERROR; return MMSYSERR_ERROR; @@ -589,6 +614,7 @@ MMRESULT WdmAudQueryMixerInfoByMMixer( IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN DWORD MixerId, IN UINT uMsg, IN LPVOID Parameter, IN DWORD Flags) @@ -596,6 +622,7 @@ LPMIXERLINEW MixLine; LPMIXERLINECONTROLSW MixControls; LPMIXERCONTROLDETAILS MixDetails; + HANDLE hMixer = NULL; MixLine = (LPMIXERLINEW)Parameter; MixControls = (LPMIXERLINECONTROLSW)Parameter; @@ -603,19 +630,23 @@ /* FIXME param checks */ + if (SoundDeviceInstance) + { + hMixer = SoundDeviceInstance->Handle; + } + switch(uMsg) { case MXDM_GETLINEINFO: - return WdmAudGetLineInfo(SoundDeviceInstance->Handle, MixLine, Flags); + return WdmAudGetLineInfo(hMixer, MixerId, MixLine, Flags); case MXDM_GETLINECONTROLS: - return WdmAudGetLineControls(SoundDeviceInstance->Handle, MixControls, Flags); + return WdmAudGetLineControls(hMixer, MixerId, MixControls, Flags); case MXDM_SETCONTROLDETAILS: - return WdmAudSetControlDetails(SoundDeviceInstance->Handle, MixDetails, Flags); - break; + return WdmAudSetControlDetails(hMixer, MixerId, MixDetails, Flags); case MXDM_GETCONTROLDETAILS: - return WdmAudGetControlDetails(SoundDeviceInstance->Handle, MixDetails, Flags); - break; + return WdmAudGetControlDetails(hMixer, MixerId, MixDetails, Flags); default: + DPRINT1("MixerId %lu, uMsg %lu, Parameter %p, Flags %lu\n", MixerId, uMsg, Parameter, Flags); SND_ASSERT(0); return MMSYSERR_NOTSUPPORTED; } @@ -633,6 +664,25 @@ return MMSYSERR_NOTSUPPORTED; } +VOID +CALLBACK +MixerEventCallback( + IN PVOID MixerEventContext, + IN HANDLE hMixer, + IN ULONG NotificationType, + IN ULONG Value) +{ + PSOUND_DEVICE_INSTANCE Instance = (PSOUND_DEVICE_INSTANCE)MixerEventContext; + + DriverCallback(Instance->WinMM.ClientCallback, + HIWORD(Instance->WinMM.Flags), + Instance->WinMM.Handle, + NotificationType, + Instance->WinMM.ClientCallbackInstanceData, + (DWORD_PTR)Value, + 0); +} + MMRESULT WdmAudSetMixerDeviceFormatByMMixer( IN PSOUND_DEVICE_INSTANCE Instance, @@ -640,11 +690,7 @@ IN PWAVEFORMATEX WaveFormat, IN DWORD WaveFormatSize) { - Instance->hNotifyEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - if ( ! Instance->hNotifyEvent ) - return MMSYSERR_NOMEM; - - if (MMixerOpen(&MixerContext, DeviceId, Instance->hNotifyEvent, NULL /* FIXME */, &Instance->Handle) == MM_STATUS_SUCCESS) + if (MMixerOpen(&MixerContext, DeviceId, (PVOID)Instance, MixerEventCallback, &Instance->Handle) == MM_STATUS_SUCCESS) return MMSYSERR_NOERROR; return MMSYSERR_BADDEVICEID; @@ -706,7 +752,19 @@ IN MMDEVICE_TYPE DeviceType, IN BOOLEAN bStartReset) { - /* FIXME */ + MIXER_STATUS Status; + + if (DeviceType == WAVE_IN_DEVICE_TYPE || DeviceType == WAVE_OUT_DEVICE_TYPE) + { + Status = MMixerSetWaveResetState(&MixerContext, SoundDeviceInstance->Handle, bStartReset); + if (Status == MM_STATUS_SUCCESS) + { + /* completed successfully */ + return MMSYSERR_NOERROR; + } + } + + return MMSYSERR_NOTSUPPORTED; } @@ -717,6 +775,29 @@ { /* FIXME */ return MMSYSERR_NOTSUPPORTED; +} + +DWORD +WINAPI +IoStreamingThread( + LPVOID lpParameter) +{ + DWORD Length; + MMRESULT Result; + LPIO_PACKET Packet = (LPIO_PACKET)lpParameter; + + Result = SyncOverlappedDeviceIoControl(Packet->hDevice, + Packet->IoCtl, + NULL, + 0, + &Packet->Header, + sizeof(KSSTREAM_HEADER), + &Length); + + Packet->CompletionRoutine(ERROR_SUCCESS, Packet->Header.DataUsed, (LPOVERLAPPED)Packet->Overlap); + + HeapFree(GetProcessHeap(), 0, Packet); + return 0; } MMRESULT @@ -727,10 +808,11 @@ IN PSOUND_OVERLAPPED Overlap, IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine) { - KSSTREAM_HEADER Packet; PSOUND_DEVICE SoundDevice; MMDEVICE_TYPE DeviceType; MMRESULT Result; + LPIO_PACKET Packet; + HANDLE hThread; Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); @@ -742,31 +824,37 @@ Result = GetSoundDeviceType(SoundDevice, &DeviceType); SND_ASSERT( Result == MMSYSERR_NOERROR ); + Packet = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IO_PACKET)); + if ( ! Packet ) + { + /* no memory */ + return MMSYSERR_NOMEM; + } + /* setup stream packet */ - ZeroMemory(&Packet, sizeof(KSSTREAM_HEADER)); - Packet.Size = sizeof(KSSTREAM_HEADER); - Packet.PresentationTime.Numerator = 1; - Packet.PresentationTime.Denominator = 1; - Packet.Data = OffsetPtr; - Packet.FrameExtent = Length; + Packet->Header.Size = sizeof(KSSTREAM_HEADER); + Packet->Header.PresentationTime.Numerator = 1; + Packet->Header.PresentationTime.Denominator = 1; + Packet->Header.Data = OffsetPtr; + Packet->Header.FrameExtent = Length; + Packet->hDevice = SoundDeviceInstance->Handle; + Packet->Overlap = Overlap; + Packet->CompletionRoutine = CompletionRoutine; + Packet->IoCtl = (DeviceType == WAVE_OUT_DEVICE_TYPE ? IOCTL_KS_WRITE_STREAM : IOCTL_KS_READ_STREAM); if (DeviceType == WAVE_OUT_DEVICE_TYPE) { - Packet.DataUsed = Length; - } - - Result = SyncOverlappedDeviceIoControl(SoundDeviceInstance->Handle, - IOCTL_KS_WRITE_STREAM, - NULL, - 0, - &Packet, - sizeof(KSSTREAM_HEADER), - &Length); - - /* HACK: - * don't call completion routine directly - */ - CompletionRoutine(ERROR_SUCCESS, Length, (LPOVERLAPPED)Overlap); + Packet->Header.DataUsed = Length; + } + + hThread = CreateThread(NULL, 0, IoStreamingThread, (LPVOID)Packet, 0, NULL); + if (hThread == NULL) + { + /* error */ + return MMSYSERR_ERROR; + } + + CloseHandle(hThread); return MMSYSERR_NOERROR; } Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.h [iso-8859-1] Fri Jan 28 11:23:37 2011 @@ -70,24 +70,28 @@ MMRESULT WdmAudGetLineInfo( IN HANDLE hMixer, + IN DWORD MixerId, IN LPMIXERLINEW MixLine, IN ULONG Flags); MMRESULT WdmAudGetLineControls( IN HANDLE hMixer, + IN DWORD MixerId, IN LPMIXERLINECONTROLSW MixControls, IN ULONG Flags); MMRESULT WdmAudSetControlDetails( IN HANDLE hMixer, + IN DWORD MixerId, IN LPMIXERCONTROLDETAILS MixDetails, IN ULONG Flags); MMRESULT WdmAudGetControlDetails( IN HANDLE hMixer, + IN DWORD MixerId, IN LPMIXERCONTROLDETAILS MixDetails, IN ULONG Flags); @@ -116,6 +120,7 @@ MMRESULT WdmAudQueryMixerInfoByMMixer( IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN DWORD DeviceId, IN UINT uMsg, IN LPVOID Parameter, IN DWORD Flags); @@ -185,6 +190,7 @@ MMRESULT WdmAudQueryMixerInfoByLegacy( IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN DWORD DeviceId, IN UINT uMsg, IN LPVOID Parameter, IN DWORD Flags); Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c [iso-8859-1] Fri Jan 28 11:23:37 2011 @@ -319,6 +319,7 @@ } VOID +CALLBACK EventCallback( IN PVOID MixerEventContext, IN HANDLE hMixer, @@ -474,7 +475,7 @@ DeviceInfo->Flags &= ~MIXER_OBJECTF_HMIXER; /* query mmixer library */ - Status = MMixerGetControlDetails(&MixerContext, DeviceInfo->hDevice, DeviceInfo->Flags, &DeviceInfo->u.MixDetails); + Status = MMixerGetControlDetails(&MixerContext, DeviceInfo->hDevice, DeviceInfo->DeviceIndex, DeviceInfo->Flags, &DeviceInfo->u.MixDetails); if (Status == MM_STATUS_SUCCESS) return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(WDMAUD_DEVICE_INFO)); @@ -496,7 +497,7 @@ DeviceInfo->Flags &= ~MIXER_OBJECTF_HMIXER; /* query mixer library */ - Status = MMixerGetLineInfo(&MixerContext, DeviceInfo->hDevice, DeviceInfo->Flags, &DeviceInfo->u.MixLine); + Status = MMixerGetLineInfo(&MixerContext, DeviceInfo->hDevice, DeviceInfo->DeviceIndex, DeviceInfo->Flags, &DeviceInfo->u.MixLine); if (Status == MM_STATUS_SUCCESS) return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(WDMAUD_DEVICE_INFO)); @@ -518,7 +519,7 @@ DeviceInfo->Flags &= ~MIXER_OBJECTF_HMIXER; /* query mixer library */ - Status = MMixerGetLineControls(&MixerContext, DeviceInfo->hDevice, DeviceInfo->Flags, &DeviceInfo->u.MixControls); + Status = MMixerGetLineControls(&MixerContext, DeviceInfo->hDevice, DeviceInfo->DeviceIndex, DeviceInfo->Flags, &DeviceInfo->u.MixControls); if (Status == MM_STATUS_SUCCESS) return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(WDMAUD_DEVICE_INFO)); @@ -542,7 +543,7 @@ DeviceInfo->Flags &= ~MIXER_OBJECTF_HMIXER; /* query mixer library */ - Status = MMixerSetControlDetails(&MixerContext, DeviceInfo->hDevice, DeviceInfo->Flags, &DeviceInfo->u.MixDetails); + Status = MMixerSetControlDetails(&MixerContext, DeviceInfo->hDevice, DeviceInfo->DeviceIndex, DeviceInfo->Flags, &DeviceInfo->u.MixDetails); if (Status == MM_STATUS_SUCCESS) return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(WDMAUD_DEVICE_INFO)); 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] Fri Jan 28 11:23:37 2011 @@ -135,7 +135,7 @@ { \ if ( ! (parameter_condition) ) \ { \ - SND_ERR(L"FAILED parameter check: %hS\n", #parameter_condition); \ + SND_ERR(L"FAILED parameter check: %hS at File %S Line %lu\n", #parameter_condition, __FILE__, __LINE__); \ return MMSYSERR_INVALPARAM; \ } \ } @@ -199,10 +199,10 @@ typedef MMRESULT (*MMMIXERQUERY_FUNC) ( IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, + IN DWORD DeviceId, IN UINT uMsg, IN LPVOID Parameter, IN DWORD Flags); - typedef MMRESULT (*MMWAVEQUERYFORMATSUPPORT_FUNC)( IN struct _SOUND_DEVICE* Device,
13 years, 11 months
1
0
0
0
[janderwald] 50531: [KS] - Merge from audio branch - Perform irp completion in dedicated function - Move Software Bus function into own file - Remove debugging code which caused crashes - Partly im...
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 28 10:37:27 2011 New Revision: 50531 URL:
http://svn.reactos.org/svn/reactos?rev=50531&view=rev
Log: [KS] - Merge from audio branch - Perform irp completion in dedicated function - Move Software Bus function into own file - Remove debugging code which caused crashes - Partly implement IKsProcessingObject interface for filter - Fix check in FindMatchingCreateItem function - Implement software bus enumerator functions [SWENUM] - Implement SwDispatchPower, SwDispatchPower Added: trunk/reactos/drivers/ksfilter/ks/swenum.c - copied unchanged from r50529, branches/audio-bringup/drivers/ksfilter/ks/swenum.c Modified: trunk/reactos/drivers/ksfilter/directory.rbuild trunk/reactos/drivers/ksfilter/ks/allocators.c trunk/reactos/drivers/ksfilter/ks/api.c trunk/reactos/drivers/ksfilter/ks/clocks.c trunk/reactos/drivers/ksfilter/ks/device.c trunk/reactos/drivers/ksfilter/ks/filter.c trunk/reactos/drivers/ksfilter/ks/filterfactory.c trunk/reactos/drivers/ksfilter/ks/irp.c trunk/reactos/drivers/ksfilter/ks/ks.rbuild trunk/reactos/drivers/ksfilter/ks/ksfunc.h trunk/reactos/drivers/ksfilter/ks/ksiface.h trunk/reactos/drivers/ksfilter/ks/kstypes.h trunk/reactos/drivers/ksfilter/ks/misc.c trunk/reactos/drivers/ksfilter/ks/pin.c trunk/reactos/drivers/ksfilter/ks/priv.h trunk/reactos/drivers/ksfilter/swenum/swenum.c trunk/reactos/drivers/ksfilter/swenum/swenum.rbuild Modified: trunk/reactos/drivers/ksfilter/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/directory…
============================================================================== --- trunk/reactos/drivers/ksfilter/directory.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/directory.rbuild [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -4,8 +4,8 @@ <directory name="ks"> <xi:include href="ks/ks.rbuild" /> </directory> - <!--<directory name="swenum"> + <directory name="swenum"> <xi:include href="swenum/swenum.rbuild" /> - </directory>--> + </directory> </group> Modified: trunk/reactos/drivers/ksfilter/ks/allocators.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/alloca…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/allocators.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/allocators.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -163,7 +163,7 @@ /* complete and forget irps */ Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; } @@ -172,7 +172,7 @@ { /* invalid request */ Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_INVALID_DEVICE_REQUEST; } @@ -190,7 +190,7 @@ Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; Irp->IoStatus.Information = sizeof(KSSTREAMALLOCATOR_FUNCTIONTABLE); /* complete and forget irp */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_BUFFER_TOO_SMALL; } if (!(Property->Flags & KSPROPERTY_TYPE_GET)) @@ -198,7 +198,7 @@ /* only support retrieving the property */ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; /* complete and forget irp */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_UNSUCCESSFUL; } @@ -212,7 +212,7 @@ Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = sizeof(KSSTREAMALLOCATOR_FUNCTIONTABLE); /* complete request */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } else if (Property->Id == KSPROPERTY_STREAMALLOCATOR_STATUS) @@ -223,7 +223,7 @@ Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; Irp->IoStatus.Information = sizeof(KSPROPERTY_STREAMALLOCATOR_STATUS); /* complete and forget irp */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_BUFFER_TOO_SMALL; } if (!(Property->Flags & KSPROPERTY_TYPE_GET)) @@ -231,7 +231,7 @@ /* only support retrieving the property */ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; /* complete and forget irp */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_UNSUCCESSFUL; } @@ -246,14 +246,14 @@ Irp->IoStatus.Information = sizeof(KSSTREAMALLOCATOR_STATUS); /* complete request */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } } /* unhandled request */ Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_SUPPORTED; } @@ -501,7 +501,7 @@ /* complete request */ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -523,7 +523,7 @@ /* complete request */ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } Modified: trunk/reactos/drivers/ksfilter/ks/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/api.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -1332,7 +1332,7 @@ /* complete request */ Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } @@ -1416,7 +1416,7 @@ IoStack->FileObject->FsContext2 = (PVOID)Header; Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; @@ -1429,7 +1429,7 @@ FreeItem(Header); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -1703,7 +1703,7 @@ if (IoStack->MajorFunction != IRP_MJ_CLOSE) { /* can be completed immediately */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return; } @@ -1711,7 +1711,7 @@ if (!NT_SUCCESS(Irp->IoStatus.Status)) { /* closing failed, complete irp */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return; } @@ -1723,135 +1723,7 @@ } -/* - @implemented -*/ -KSDDKAPI -NTSTATUS -NTAPI -KsCreateBusEnumObject( - IN PWCHAR BusIdentifier, - IN PDEVICE_OBJECT BusDeviceObject, - IN PDEVICE_OBJECT PhysicalDeviceObject, - IN PDEVICE_OBJECT PnpDeviceObject OPTIONAL, - IN REFGUID InterfaceGuid OPTIONAL, - IN PWCHAR ServiceRelativePath OPTIONAL) -{ - ULONG Length; - NTSTATUS Status = STATUS_SUCCESS; - UNICODE_STRING ServiceKeyPath = RTL_CONSTANT_STRING(L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Services\\"); - PBUS_ENUM_DEVICE_EXTENSION BusDeviceExtension; - PDEVICE_EXTENSION DeviceExtension; - - /* calculate sizeof bus enum device extension */ - Length = wcslen(BusIdentifier) * sizeof(WCHAR); - Length += sizeof(BUS_ENUM_DEVICE_EXTENSION); - - BusDeviceExtension = AllocateItem(NonPagedPool, Length); - if (!BusDeviceExtension) - { - /* not enough memory */ - return STATUS_INSUFFICIENT_RESOURCES; - } - - /* zero device extension */ - RtlZeroMemory(BusDeviceExtension, sizeof(BUS_ENUM_DEVICE_EXTENSION)); - - /* initialize bus device extension */ - wcscpy(BusDeviceExtension->BusIdentifier, BusIdentifier); - - /* allocate service path string */ - Length = ServiceKeyPath.MaximumLength; - Length += BusDeviceObject->DriverObject->DriverExtension->ServiceKeyName.MaximumLength; - - if (ServiceRelativePath) - { - /* relative path for devices */ - Length += wcslen(ServiceRelativePath) + 2 * sizeof(WCHAR); - } - - BusDeviceExtension->ServicePath.Length = 0; - BusDeviceExtension->ServicePath.MaximumLength = Length; - BusDeviceExtension->ServicePath.Buffer = AllocateItem(NonPagedPool, Length); - - if (!BusDeviceExtension->ServicePath.Buffer) - { - /* not enough memory */ - FreeItem(BusDeviceExtension); - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlAppendUnicodeStringToString(&BusDeviceExtension->ServicePath, &ServiceKeyPath); - RtlAppendUnicodeStringToString(&BusDeviceExtension->ServicePath, &BusDeviceObject->DriverObject->DriverExtension->ServiceKeyName); - - if (ServiceRelativePath) - { - RtlAppendUnicodeToString(&BusDeviceExtension->ServicePath, L"\\"); - RtlAppendUnicodeToString(&BusDeviceExtension->ServicePath, ServiceRelativePath); - } - - if (InterfaceGuid) - { - /* register an device interface */ - Status = IoRegisterDeviceInterface(PhysicalDeviceObject, InterfaceGuid, NULL, &BusDeviceExtension->SymbolicLinkName); - - /* check for success */ - if (!NT_SUCCESS(Status)) - { - FreeItem(BusDeviceExtension->ServicePath.Buffer); - FreeItem(BusDeviceExtension); - return Status; - } - - /* now enable device interface */ - Status = IoSetDeviceInterfaceState(&BusDeviceExtension->SymbolicLinkName, TRUE); - - if (!NT_SUCCESS(Status)) - { - FreeItem(BusDeviceExtension->ServicePath.Buffer); - FreeItem(BusDeviceExtension); - return Status; - } - - /* set state enabled */ - BusDeviceExtension->Enabled = TRUE; - } - - /* store device objects */ - BusDeviceExtension->BusDeviceObject = BusDeviceObject; - BusDeviceExtension->PnpDeviceObject = PnpDeviceObject; - BusDeviceExtension->PhysicalDeviceObject = PhysicalDeviceObject; - - if (!PnpDeviceObject) - { - BusDeviceExtension->PnpDeviceObject = IoAttachDeviceToDeviceStack(BusDeviceObject, PhysicalDeviceObject); - - if (!BusDeviceExtension->PnpDeviceObject) - { - /* failed to attach device */ - if (BusDeviceExtension->Enabled) - { - IoSetDeviceInterfaceState(&BusDeviceExtension->SymbolicLinkName, FALSE); - RtlFreeUnicodeString(&BusDeviceExtension->SymbolicLinkName); - } - - /* free device extension */ - FreeItem(BusDeviceExtension->ServicePath.Buffer); - FreeItem(BusDeviceExtension); - - return STATUS_DEVICE_REMOVED; - } - } - - /* attach device extension */ - DeviceExtension = (PDEVICE_EXTENSION)BusDeviceObject->DeviceExtension; - DeviceExtension->DeviceHeader = (PKSIDEVICE_HEADER)BusDeviceExtension; - - /* FIXME scan bus and invalidate device relations */ - return Status; -} - - NTSTATUS +NTSTATUS NTAPI KspSetGetBusDataCompletion( IN PDEVICE_OBJECT DeviceObject, @@ -1979,47 +1851,6 @@ } -/* - @unimplemented -*/ -KSDDKAPI -NTSTATUS -NTAPI -KsGetBusEnumIdentifier( - IN PIRP Irp) -{ - UNIMPLEMENTED - - return STATUS_UNSUCCESSFUL; -} - -/* - @unimplemented -*/ -KSDDKAPI -NTSTATUS -NTAPI -KsGetBusEnumParentFDOFromChildPDO( - IN PDEVICE_OBJECT DeviceObject, - OUT PDEVICE_OBJECT *FunctionalDeviceObject) -{ - UNIMPLEMENTED - return STATUS_UNSUCCESSFUL; -} - -/* - @unimplemented -*/ -KSDDKAPI -NTSTATUS -NTAPI -KsGetBusEnumPnpDeviceObject( - IN PDEVICE_OBJECT DeviceObject, - IN PDEVICE_OBJECT *PnpDeviceObject) -{ - UNIMPLEMENTED - return STATUS_UNSUCCESSFUL; -} /* @implemented @@ -2059,33 +1890,6 @@ BasicHeader->Type == KsObjectTypeFilter || BasicHeader->Type == KsObjectTypePin); return (PVOID)BasicHeader->Next.Pin; -} - -/* - @unimplemented -*/ -KSDDKAPI -NTSTATUS -NTAPI -KsInstallBusEnumInterface( - PIRP Irp) -{ - UNIMPLEMENTED - return STATUS_UNSUCCESSFUL; -} - -/* - @unimplemented -*/ -KSDDKAPI -NTSTATUS -NTAPI -KsIsBusEnumChildDevice( - IN PDEVICE_OBJECT DeviceObject, - OUT PBOOLEAN ChildDevice) -{ - UNIMPLEMENTED - return STATUS_UNSUCCESSFUL; } ULONG @@ -2602,104 +2406,6 @@ @unimplemented */ KSDDKAPI -NTSTATUS -NTAPI -KsServiceBusEnumCreateRequest( - IN PDEVICE_OBJECT DeviceObject, - IN OUT PIRP Irp) -{ - UNIMPLEMENTED - return STATUS_UNSUCCESSFUL; -} - - -/* - @unimplemented -*/ -KSDDKAPI -NTSTATUS -NTAPI -KsServiceBusEnumPnpRequest( - IN PDEVICE_OBJECT DeviceObject, - IN OUT PIRP Irp) -{ - UNIMPLEMENTED - return STATUS_UNSUCCESSFUL; -} - -VOID -NTAPI -KspRemoveBusInterface( - PVOID Ctx) -{ - PKSREMOVE_BUS_INTERFACE_CTX Context =(PKSREMOVE_BUS_INTERFACE_CTX)Ctx; - - /* TODO - * get SWENUM_INSTALL_INTERFACE struct - * open device key and delete the keys - */ - - UNIMPLEMENTED - - /* set status */ - Context->Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - - - /* signal completion */ - KeSetEvent(&Context->Event, IO_NO_INCREMENT, FALSE); -} - -/* - @unimplemented -*/ -KSDDKAPI -NTSTATUS -NTAPI -KsRemoveBusEnumInterface( - IN PIRP Irp) -{ - KPROCESSOR_MODE Mode; - LUID luid; - KSREMOVE_BUS_INTERFACE_CTX Ctx; - WORK_QUEUE_ITEM WorkItem; - - /* get previous mode */ - Mode = ExGetPreviousMode(); - - /* convert to luid */ - luid = RtlConvertUlongToLuid(SE_LOAD_DRIVER_PRIVILEGE); - - /* perform access check */ - if (!SeSinglePrivilegeCheck(luid, Mode)) - { - /* insufficient privileges */ - return STATUS_PRIVILEGE_NOT_HELD; - } - /* initialize event */ - KeInitializeEvent(&Ctx.Event, NotificationEvent, FALSE); - - /* store irp in ctx */ - Ctx.Irp = Irp; - - /* initialize work item */ - ExInitializeWorkItem(&WorkItem, KspRemoveBusInterface, (PVOID)&Ctx); - - /* now queue the work item */ - ExQueueWorkItem(&WorkItem, DelayedWorkQueue); - - /* wait for completion */ - KeWaitForSingleObject(&Ctx.Event, Executive, KernelMode, FALSE, NULL); - - /* return result */ - return Ctx.Irp->IoStatus.Status; - -} - - -/* - @unimplemented -*/ -KSDDKAPI PUNKNOWN NTAPI KsRegisterAggregatedClientUnknown( Modified: trunk/reactos/drivers/ksfilter/ks/clocks.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/clocks…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/clocks.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/clocks.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -339,7 +339,7 @@ Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } @@ -353,7 +353,7 @@ UNIMPLEMENTED Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } Modified: trunk/reactos/drivers/ksfilter/ks/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -282,8 +282,6 @@ NTSTATUS Status; PCM_RESOURCE_LIST TranslatedResourceList; PCM_RESOURCE_LIST UntranslatedResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor, UnPartialDescriptor; - ULONG Index; /* get current stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); @@ -302,42 +300,14 @@ { DPRINT1("NextDevice object failed to start with %x\n", Status); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } TranslatedResourceList = IoStack->Parameters.StartDevice.AllocatedResourcesTranslated; UntranslatedResourceList = IoStack->Parameters.StartDevice.AllocatedResources; - DPRINT("ResourceDescriptorCount %lu\n", TranslatedResourceList->List[0].PartialResourceList.Count); - for (Index = 0; Index < TranslatedResourceList->List[0].PartialResourceList.Count; Index ++ ) - { - PartialDescriptor = &TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index]; - UnPartialDescriptor = &UntranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index]; - DPRINT("Descriptor Type %u\n", PartialDescriptor->Type); - - if (PartialDescriptor->Type == CmResourceTypeInterrupt) - { - DPRINT("CmResourceTypeInterrupt Index %u TRANS Interrupt Number Affinity %x Level %u Vector %u Flags %x Share %x\n", Index, PartialDescriptor->u.Interrupt.Affinity, PartialDescriptor->u.Interrupt.Level, PartialDescriptor->u.Interrupt.Vector, PartialDescriptor->Flags, PartialDescriptor->ShareDisposition); - DPRINT("CmResourceTypeInterrupt Index %u UNTRANS Interrupt Number Affinity %x Level %u Vector %u Flags %x Share %x\\n", Index, UnPartialDescriptor->u.Interrupt.Affinity, UnPartialDescriptor->u.Interrupt.Level, UnPartialDescriptor->u.Interrupt.Vector, UnPartialDescriptor->Flags, UnPartialDescriptor->ShareDisposition); - - } - else if (PartialDescriptor->Type == CmResourceTypePort) - { - DPRINT("CmResourceTypePort Index %u TRANS Port Length %u Start %u %u Flags %x Share %x\n", Index, PartialDescriptor->u.Port.Length, PartialDescriptor->u.Port.Start.HighPart, PartialDescriptor->u.Port.Start.LowPart, PartialDescriptor->Flags, PartialDescriptor->ShareDisposition); - DPRINT("CmResourceTypePort Index %u UNTRANS Port Length %u Start %u %u Flags %x Share %x\n", Index, UnPartialDescriptor->u.Port.Length, UnPartialDescriptor->u.Port.Start.HighPart, UnPartialDescriptor->u.Port.Start.LowPart, UnPartialDescriptor->Flags, UnPartialDescriptor->ShareDisposition); - } - else if (PartialDescriptor->Type == CmResourceTypeMemory) - { - DPRINT("CmResourceTypeMemory Index %u TRANS Start %x Length %u Flags %x Share %x\n", Index, PartialDescriptor->u.Memory.Start.LowPart, PartialDescriptor->u.Memory.Length, PartialDescriptor->Flags, PartialDescriptor->ShareDisposition); - DPRINT("CmResourceTypeMemory Index %u TRANS Start %x Length %u Flags %x Share %x\n", Index, UnPartialDescriptor->u.Memory.Start.LowPart, UnPartialDescriptor->u.Memory.Length, UnPartialDescriptor->Flags, UnPartialDescriptor->ShareDisposition); - } - } - ASSERT(DeviceHeader->KsDevice.Descriptor); - ASSERT(DeviceHeader->KsDevice.Descriptor->Dispatch); - ASSERT(DeviceHeader->KsDevice.Descriptor->Dispatch->Start); - /* do we have a device descriptor */ if (DeviceHeader->KsDevice.Descriptor) @@ -361,7 +331,7 @@ { DPRINT1("Driver: failed to start %x\n", Status); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -406,12 +376,17 @@ Status = KspSetFilterFactoriesState(DeviceHeader, TRUE); } } + else + { + /* set state to run */ + DeviceHeader->KsDevice.Started = TRUE; + } } /* store result */ Irp->IoStatus.Status = Status; /* complete request */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); if (Ctx) { @@ -420,7 +395,7 @@ } /* return result */ - DPRINT1("IKsDevice_PnpStartDevice Status %x PostStartRoutine %p\n", Status, Ctx); + DPRINT("IKsDevice_PnpStartDevice Status %x PostStartRoutine %p\n", Status, Ctx); return Status; } @@ -477,7 +452,7 @@ { DPRINT1("Driver: query stop failed %x\n", Status); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -487,7 +462,7 @@ DPRINT("Next Device: Status %x\n", Status); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -513,7 +488,7 @@ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } case IRP_MN_QUERY_INTERFACE: @@ -536,7 +511,7 @@ /* driver supports a private interface */ DPRINT1("IRP_MN_QUERY_INTERFACE Device supports interface\n"); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -545,7 +520,7 @@ DPRINT1("IRP_MN_QUERY_INTERFACE Next Device: Status %x\n", Status); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } case IRP_MN_QUERY_DEVICE_RELATIONS: @@ -556,7 +531,7 @@ DPRINT("IRP_MN_QUERY_DEVICE_RELATIONS Next Device: Status %x\n", Status); //Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: @@ -567,7 +542,7 @@ DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS Next Device: Status %x\n", Status); //Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: @@ -578,7 +553,7 @@ DPRINT("IRP_MN_QUERY_RESOURCE_REQUIREMENTS Next Device: Status %x\n", Status); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } default: @@ -587,7 +562,7 @@ Status = KspForwardIrpSynchronous(DeviceObject, Irp); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } } @@ -604,7 +579,7 @@ Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } @@ -669,17 +644,10 @@ } } - /* acquire list lock */ + /* release list lock */ IKsDevice_fnReleaseDevice((IKsDevice*)&DeviceHeader->BasicHeader.OuterUnknown); - if (Status != STATUS_PENDING) - { - Irp->IoStatus.Information = 0; - /* set return status */ - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } - + /* done */ return Status; @@ -703,7 +671,7 @@ PKSIOBJECT_BAG Bag; NTSTATUS Status = STATUS_SUCCESS; - DPRINT("KsInitializeDevice Descriptor %p\n", Descriptor); + DPRINT1("KsInitializeDevice Descriptor %p\n", Descriptor); /* get device extension */ DeviceExtension = (PDEVICE_EXTENSION)FunctionalDeviceObject->DeviceExtension; @@ -714,7 +682,7 @@ /* point to allocated header */ Header = DeviceExtension->DeviceHeader; - DPRINT("DeviceHeader %p\n", DeviceExtension->DeviceHeader); + DPRINT1("DeviceHeader %p\n", DeviceExtension->DeviceHeader); if (Descriptor && Descriptor->Dispatch) { @@ -896,7 +864,7 @@ IKsDevice * Device; PKSIDEVICE_HEADER DeviceHeader = (PKSIDEVICE_HEADER)Header; - DPRINT1("KsDereferenceSoftwareBusObject DeviceHeader %p\n", Header); + DPRINT("KsDereferenceSoftwareBusObject DeviceHeader %p\n", Header); /* get device interface */ Device = (IKsDevice*)DeviceHeader->BasicHeader.OuterUnknown; Modified: trunk/reactos/drivers/ksfilter/ks/filter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -16,6 +16,7 @@ IKsControlVtbl *lpVtblKsControl; IKsFilterFactory * FilterFactory; + IKsProcessingObjectVtbl * lpVtblKsProcessingObject; LONG ref; PKSIOBJECT_HEADER ObjectHeader; @@ -25,6 +26,9 @@ KMUTEX ControlMutex; KMUTEX ProcessingMutex; + PKSWORKER Worker; + WORK_QUEUE_ITEM WorkItem; + KSGATE Gate; PFNKSFILTERPOWER Sleep; PFNKSFILTERPOWER Wake; @@ -70,6 +74,196 @@ } }; +NTSTATUS +NTAPI +IKsProcessingObject_fnQueryInterface( + IKsProcessingObject * iface, + IN REFIID refiid, + OUT PVOID* Output) +{ + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtblKsProcessingObject); + + if (IsEqualGUIDAligned(refiid, &IID_IUnknown)) + { + *Output = &This->Header.OuterUnknown; + _InterlockedIncrement(&This->ref); + return STATUS_SUCCESS; + } + return STATUS_UNSUCCESSFUL; +} + +ULONG +NTAPI +IKsProcessingObject_fnAddRef( + IKsProcessingObject * iface) +{ + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtblKsProcessingObject); + + return InterlockedIncrement(&This->ref); +} + +ULONG +NTAPI +IKsProcessingObject_fnRelease( + IKsProcessingObject * iface) +{ + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtblKsProcessingObject); + + InterlockedDecrement(&This->ref); + + /* Return new reference count */ + return This->ref; +} + +VOID +NTAPI +IKsProcessingObject_fnProcessingObjectWork( + IKsProcessingObject * iface) +{ + NTSTATUS Status; + LARGE_INTEGER TimeOut; + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtblKsProcessingObject); + + DPRINT1("processing object\n"); + /* first check if running at passive level */ + if (KeGetCurrentIrql() == PASSIVE_LEVEL) + { + /* acquire processing mutex */ + KeWaitForSingleObject(&This->ControlMutex, Executive, KernelMode, FALSE, NULL); + } + else + { + /* dispatch level processing */ + if (KeReadStateMutex(&This->ControlMutex) == 0) + { + /* some thread was faster */ + DPRINT1("processing object too slow\n"); + return; + } + + /* acquire processing mutex */ + TimeOut.QuadPart = 0LL; + Status = KeWaitForSingleObject(&This->ControlMutex, Executive, KernelMode, FALSE, &TimeOut); + + if (Status == STATUS_TIMEOUT) + { + /* some thread was faster */ + DPRINT1("processing object too slow\n"); + return; + } + } + + do + { + + /* check if the and-gate has been enabled again */ + if (&This->Gate.Count != 0) + { + /* gate is open */ + DPRINT1("processing object gate open\n"); + break; + } + + DPRINT1("IKsProcessingObject_fnProcessingObjectWork not implemented\n"); + ASSERT(0); + + }while(TRUE); + + /* release process mutex */ + KeReleaseMutex(&This->ProcessingMutex, FALSE); +} + +PKSGATE +NTAPI +IKsProcessingObject_fnGetAndGate( + IKsProcessingObject * iface) +{ + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtblKsProcessingObject); + + /* return and gate */ + return &This->Gate; +} + +VOID +NTAPI +IKsProcessingObject_fnProcess( + IKsProcessingObject * iface, + IN BOOLEAN Asynchronous) +{ + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtblKsProcessingObject); + + /* should the action be asynchronous */ + if (Asynchronous) + { + /* queue work item */ + KsQueueWorkItem(This->Worker, &This->WorkItem); +DPRINT1("queueing\n"); + /* done */ + return; + } + + /* does the filter require explicit deferred processing */ + if ((This->Filter.Descriptor->Flags & (KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING | KSFILTER_FLAG_CRITICAL_PROCESSING | KSFILTER_FLAG_HYPERCRITICAL_PROCESSING)) && + KeGetCurrentIrql() > PASSIVE_LEVEL) + { + /* queue work item */ + KsQueueWorkItem(This->Worker, &This->WorkItem); +DPRINT1("queueing\n"); + /* done */ + return; + } +DPRINT1("invoke\n"); + /* call worker routine directly */ + iface->lpVtbl->ProcessingObjectWork(iface); +} + +VOID +NTAPI +IKsProcessingObject_fnReset( + IKsProcessingObject * iface) +{ + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(iface, IKsFilterImpl, lpVtblKsProcessingObject); + + /* acquire processing mutex */ + KeWaitForSingleObject(&This->ProcessingMutex, Executive, KernelMode, FALSE, NULL); + + /* check if the filter supports dispatch routines */ + if (This->Filter.Descriptor->Dispatch) + { + /* has the filter a reset routine */ + if (This->Filter.Descriptor->Dispatch->Reset) + { + /* reset filter */ + This->Filter.Descriptor->Dispatch->Reset(&This->Filter); + } + } + + /* release process mutex */ + KeReleaseMutex(&This->ProcessingMutex, FALSE); +} + +VOID +NTAPI +IKsProcessingObject_fnTriggerNotification( + IKsProcessingObject * iface) +{ + +} + +static IKsProcessingObjectVtbl vt_IKsProcessingObject = +{ + IKsProcessingObject_fnQueryInterface, + IKsProcessingObject_fnAddRef, + IKsProcessingObject_fnRelease, + IKsProcessingObject_fnProcessingObjectWork, + IKsProcessingObject_fnGetAndGate, + IKsProcessingObject_fnProcess, + IKsProcessingObject_fnReset, + IKsProcessingObject_fnTriggerNotification +}; + + +//--------------------------------------------------------------------------------------------------------- NTSTATUS NTAPI IKsControl_fnQueryInterface( @@ -485,7 +679,7 @@ Irp->IoStatus.Status = Status; /* complete and forget irp */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } return Status; @@ -522,7 +716,7 @@ /* save the result */ Irp->IoStatus.Status = Status; /* complete irp */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); /* remove our instance from the filter factory */ IKsFilter_RemoveFilterFromFilterFactory(This, This->Factory); @@ -535,7 +729,7 @@ /* complete and forget */ Irp->IoStatus.Status = Status; /* complete irp */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); } /* done */ @@ -881,7 +1075,7 @@ if (Status != STATUS_PENDING) { Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); } /* done */ @@ -1227,7 +1421,7 @@ { /* complete request */ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); } /* done */ @@ -1243,7 +1437,7 @@ { UNIMPLEMENTED Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_UNSUCCESSFUL; } @@ -1356,6 +1550,20 @@ }while(TRUE); } +VOID +NTAPI +IKsFilter_FilterCentricWorker( + IN PVOID Ctx) +{ + IKsProcessingObject * Object = (IKsProcessingObject*)Ctx; + + /* sanity check */ + ASSERT(Object); + + /* perform work */ + Object->lpVtbl->ProcessingObjectWork(Object); +} + NTSTATUS NTAPI KspCreateFilter( @@ -1377,17 +1585,27 @@ /* get the filter factory */ Factory = iface->lpVtbl->GetStruct(iface); - if (!Factory || !Factory->FilterDescriptor || !Factory->FilterDescriptor->Dispatch || !Factory->FilterDescriptor->Dispatch->Create) + if (!Factory || !Factory->FilterDescriptor) { /* Sorry it just will not work */ return STATUS_UNSUCCESSFUL; + } + + if (Factory->FilterDescriptor->Flags & KSFILTER_FLAG_DENY_USERMODE_ACCESS) + { + if (Irp->RequestorMode == UserMode) + { + /* filter not accessible from user mode */ + DPRINT1("Access denied\n"); + return STATUS_UNSUCCESSFUL; + } } /* allocate filter instance */ This = AllocateItem(NonPagedPool, sizeof(IKsFilterImpl)); if (!This) { - DPRINT("KspCreateFilter OutOfMemory\n"); + DPRINT1("KspCreateFilter OutOfMemory\n"); return STATUS_INSUFFICIENT_RESOURCES; } @@ -1397,7 +1615,7 @@ { /* no memory */ FreeItem(This); - DPRINT("KspCreateFilter OutOfMemory\n"); + DPRINT1("KspCreateFilter OutOfMemory\n"); return STATUS_INSUFFICIENT_RESOURCES; } KsDevice = (IKsDevice*)&DeviceExtension->DeviceHeader->BasicHeader.OuterUnknown; @@ -1424,11 +1642,9 @@ /* no memory */ FreeItem(This->Filter.Bag); FreeItem(This); - DPRINT("KspCreateFilter OutOfMemory\n"); + DPRINT1("KspCreateFilter OutOfMemory\n"); return STATUS_INSUFFICIENT_RESOURCES; } - - DPRINT("KspCreateFilter Flags %lx\n", Factory->FilterDescriptor->Flags); /* initialize pin create item */ CreateItem[0].Create = IKsFilter_DispatchCreatePin; @@ -1446,11 +1662,13 @@ This->ref = 1; This->Header.OuterUnknown = (PUNKNOWN)&vt_IKsFilter; This->lpVtblKsControl = &vt_IKsControl; + This->lpVtblKsProcessingObject = &vt_IKsProcessingObject; This->Factory = Factory; This->FilterFactory = iface; This->FileObject = IoStack->FileObject; KeInitializeMutex(&This->ProcessingMutex, 0); + /* initialize basic header */ This->Header.KsDevice = &DeviceExtension->DeviceHeader->KsDevice; This->Header.Parent.KsFilterFactory = iface->lpVtbl->GetStruct(iface); @@ -1460,16 +1678,38 @@ InitializeListHead(&This->Header.EventList); KeInitializeSpinLock(&This->Header.EventListLock); + /* initialize and gate */ + KsGateInitializeAnd(&This->Gate, NULL); + + /* FIXME initialize and gate based on pin flags */ + + /* initialize work item */ + ExInitializeWorkItem(&This->WorkItem, IKsFilter_FilterCentricWorker, (PVOID)This->lpVtblKsProcessingObject); + + /* allocate counted work item */ + Status = KsRegisterCountedWorker(HyperCriticalWorkQueue, &This->WorkItem, &This->Worker); + if (!NT_SUCCESS(Status)) + { + /* what can go wrong, goes wrong */ + DPRINT1("KsRegisterCountedWorker failed with %lx\n", Status); + FreeItem(This); + FreeItem(CreateItem); + return Status; + } + /* allocate the stream descriptors */ Status = IKsFilter_CreateDescriptors(This, (PKSFILTER_DESCRIPTOR)Factory->FilterDescriptor); if (!NT_SUCCESS(Status)) { /* what can go wrong, goes wrong */ + DPRINT1("IKsFilter_CreateDescriptors failed with %lx\n", Status); + KsUnregisterWorker(This->Worker); FreeItem(This); FreeItem(CreateItem); - DPRINT("IKsFilter_CreateDescriptors failed with %lx\n", Status); return Status; } + + /* does the filter have a filter dispatch */ if (Factory->FilterDescriptor->Dispatch) @@ -1489,6 +1729,7 @@ DPRINT1("Driver: Status %x\n", Status); /* free filter instance */ + KsUnregisterWorker(This->Worker); FreeItem(This); FreeItem(CreateItem); return Status; @@ -1515,7 +1756,7 @@ IKsFilter_AttachFilterToFilterFactory(This, This->Header.Parent.KsFilterFactory); /* completed initialization */ - DPRINT("KspCreateFilter done %lx KsDevice %p\n", Status, This->Header.KsDevice); + DPRINT1("KspCreateFilter done %lx KsDevice %p\n", Status, This->Header.KsDevice); return Status; } @@ -1599,7 +1840,7 @@ } /* - @unimplemented + @implemented */ KSDDKAPI VOID @@ -1608,7 +1849,20 @@ IN PKSFILTER Filter, IN BOOLEAN Asynchronous) { - UNIMPLEMENTED + PKSGATE Gate; + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(Filter, IKsFilterImpl, Filter); + + /* get gate */ + Gate = This->lpVtblKsProcessingObject->GetAndGate((IKsProcessingObject*)This->lpVtblKsProcessingObject); + + if (!KsGateCaptureThreshold(Gate)) + { + /* filter control gate is closed */ + return; + } +DPRINT1("processing\n"); + /* try initiate processing */ + This->lpVtblKsProcessingObject->Process((IKsProcessingObject*)This->lpVtblKsProcessingObject, Asynchronous); } /* @@ -1710,8 +1964,10 @@ KsFilterGetAndGate( IN PKSFILTER Filter) { - UNIMPLEMENTED - return NULL; + IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(Filter, IKsFilterImpl, Filter); + + /* return and-gate */ + return &This->Gate; } /* Modified: trunk/reactos/drivers/ksfilter/ks/filterfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -69,7 +69,7 @@ { Irp->IoStatus.Information = 0; Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); } return Status; Modified: trunk/reactos/drivers/ksfilter/ks/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/irp.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -34,7 +34,7 @@ { /* no create item */ Irp->IoStatus.Status = STATUS_NO_SECURITY_ON_OBJECT; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NO_SECURITY_ON_OBJECT; } @@ -50,7 +50,7 @@ Irp->IoStatus.Status = Status; Irp->IoStatus.Information = Length; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -80,7 +80,7 @@ { /* no create item */ Irp->IoStatus.Status = STATUS_NO_SECURITY_ON_OBJECT; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NO_SECURITY_ON_OBJECT; } @@ -109,7 +109,7 @@ /* store result */ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -1154,7 +1154,7 @@ IN PIRP Irp) { Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_INVALID_DEVICE_REQUEST; } @@ -1198,7 +1198,7 @@ /* complete request */ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; @@ -1643,14 +1643,15 @@ /* get current irp stack */ IoStack = IoGetCurrentIrpStackLocation(Irp); - DPRINT("KsAddIrpToCancelableQueue QueueHead %p SpinLock %p Irp %p ListLocation %x DriverCancel %p\n", QueueHead, SpinLock, Irp, ListLocation, DriverCancel); + DPRINT1("KsAddIrpToCancelableQueue QueueHead %p SpinLock %p Irp %p ListLocation %x DriverCancel %p\n", QueueHead, SpinLock, Irp, ListLocation, DriverCancel); // HACK for ms portcls if (IoStack->MajorFunction == IRP_MJ_CREATE) { // complete the request + DPRINT1("MS HACK\n"); Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return; } @@ -1736,7 +1737,7 @@ { /* let's complete it */ Irp->IoStatus.Status = STATUS_CANCELLED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); } } @@ -1795,14 +1796,12 @@ continue; } - ASSERT(CreateItemEntry->CreateItem->ObjectClass.Buffer); - DPRINT("CreateItem %S Length %u Request %wZ %u\n", CreateItemEntry->CreateItem->ObjectClass.Buffer, CreateItemEntry->CreateItem->ObjectClass.Length, &RefString, - BufferSize); - - if (CreateItemEntry->CreateItem->ObjectClass.Length > BufferSize) + RefString.Length); + + if (CreateItemEntry->CreateItem->ObjectClass.Length > RefString.Length) { /* create item doesnt match in length */ Entry = Entry->Flink; @@ -1853,7 +1852,7 @@ Irp->IoStatus.Information = 0; /* set return status */ Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } @@ -1893,7 +1892,7 @@ Irp->IoStatus.Information = 0; /* set return status */ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_UNSUCCESSFUL; } @@ -1929,7 +1928,7 @@ Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; /* complete and forget */ - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; } @@ -2036,6 +2035,7 @@ /* get device extension */ DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension; + /* get device header */ DeviceHeader = DeviceExtension->DeviceHeader; Modified: trunk/reactos/drivers/ksfilter/ks/ks.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/ks.rbu…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/ks.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/ks.rbuild [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -32,4 +32,5 @@ <file>unknown.c</file> <file>worker.c</file> <file>kcom.c</file> + <file>swenum.c</file> </module> Modified: trunk/reactos/drivers/ksfilter/ks/ksfunc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/ksfunc…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/ksfunc.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/ksfunc.h [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -5,6 +5,13 @@ #define TAG_KSDEVICE 'DESK' #define TAG_KSOBJECT_TAG 'HOSK' + +VOID +CompleteRequest( + PIRP Irp, + CCHAR PriorityBoost); + + NTSTATUS NTAPI Modified: trunk/reactos/drivers/ksfilter/ks/ksiface.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/ksifac…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/ksiface.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/ksiface.h [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -307,3 +307,34 @@ STDMETHOD_(NTSTATUS, CheckIoCapability)(THIS_ IN ULONG Unknown)PURE; }; + +#undef INTERFACE + + +/***************************************************************************** + * IKsProcessingObject + ***************************************************************************** + */ + +#undef INTERFACE +#define INTERFACE IKsProcessingObject + +DECLARE_INTERFACE_(IKsProcessingObject, IUnknown) +{ + DEFINE_ABSTRACT_UNKNOWN() + + STDMETHOD_(VOID, ProcessingObjectWork)(THIS) PURE; + + STDMETHOD_(PKSGATE, GetAndGate)(THIS) PURE; + + STDMETHOD_(VOID, Process)(THIS_ + IN BOOLEAN Asynchronous)PURE; + + STDMETHOD_(VOID, Reset)(THIS) PURE; + + STDMETHOD_(VOID, TriggerNotification)(THIS) PURE; + +}; + +#undef INTERFACE + Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -136,12 +136,6 @@ typedef struct { - PIRP Irp; - KEVENT Event; -}KSREMOVE_BUS_INTERFACE_CTX, *PKSREMOVE_BUS_INTERFACE_CTX; - -typedef struct -{ PLIST_ENTRY List; PFILE_OBJECT FileObject; PKSEVENT_ENTRY EventEntry; @@ -150,19 +144,96 @@ typedef BOOLEAN (NTAPI *PKSEVENT_SYNCHRONIZED_ROUTINE)(PKSEVENT_CTX Context); -typedef struct -{ - BOOLEAN Enabled; - +struct __BUS_ENUM_DEVICE_EXTENSION__; +struct __BUS_DEVICE_ENTRY__; + +typedef struct +{ + LIST_ENTRY Entry; + ULONG IsBus; + union + { + PDEVICE_OBJECT DeviceObject; + ULONG DeviceReferenceCount; + }; + union + { + struct __BUS_DEVICE_ENTRY__* DeviceEntry; + ULONG Dummy1; + }; + struct __BUS_ENUM_DEVICE_EXTENSION__ *BusDeviceExtension; + ULONG DeviceObjectReferenceCount; +}COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION; + +typedef struct +{ + PCOMMON_DEVICE_EXTENSION Ext; +}DEV_EXTENSION, *PDEV_EXTENSION; + +typedef struct +{ + LIST_ENTRY Entry; + GUID InterfaceGuid; + UNICODE_STRING SymbolicLink; +}BUS_INSTANCE_ENTRY, *PBUS_INSTANCE_ENTRY; + + + +typedef enum +{ + NotStarted = 0, // Not started yet + Started, // Device has received the START_DEVICE IRP + StopPending, // Device has received the QUERY_STOP IRP + Stopped, // Device has received the STOP_DEVICE IRP + RemovePending, // Device has received the QUERY_REMOVE IRP + SurpriseRemovePending, // Device has received the SURPRISE_REMOVE IRP + Deleted +}DEVICE_STATE; + + +typedef struct __BUS_DEVICE_ENTRY__ +{ + LIST_ENTRY Entry; + LIST_ENTRY DeviceInterfaceList; + LIST_ENTRY IrpPendingList; + PDEVICE_OBJECT PDO; + DEVICE_STATE DeviceState; + GUID DeviceGuid; + LPWSTR PDODeviceName; + LPWSTR DeviceName; + LPWSTR BusId; + LARGE_INTEGER TimeCreated; + LARGE_INTEGER TimeExpired; + LPWSTR Instance; +}BUS_DEVICE_ENTRY, *PBUS_DEVICE_ENTRY; + +typedef struct __BUS_ENUM_DEVICE_EXTENSION__ +{ + COMMON_DEVICE_EXTENSION Common; + KSPIN_LOCK Lock; + KEVENT Event; + UNICODE_STRING DeviceInterfaceLink; + PDEVICE_OBJECT PhysicalDeviceObject; PDEVICE_OBJECT PnpDeviceObject; - PDEVICE_OBJECT PhysicalDeviceObject; PDEVICE_OBJECT BusDeviceObject; - + ULONG PdoCreated; + KTIMER Timer; + KDPC Dpc; + WORK_QUEUE_ITEM WorkItem; + ULONG DeviceAttached; UNICODE_STRING ServicePath; - UNICODE_STRING SymbolicLinkName; WCHAR BusIdentifier[1]; }BUS_ENUM_DEVICE_EXTENSION, *PBUS_ENUM_DEVICE_EXTENSION; + +typedef struct +{ + PIRP Irp; + PBUS_ENUM_DEVICE_EXTENSION BusDeviceExtension; + KEVENT Event; + NTSTATUS Status; + WORK_QUEUE_ITEM WorkItem; +}BUS_INSTALL_ENUM_CONTEXT, *PBUS_INSTALL_ENUM_CONTEXT; typedef struct { Modified: trunk/reactos/drivers/ksfilter/ks/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/misc.c…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/misc.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -8,6 +8,19 @@ #include "priv.h" + +VOID +CompleteRequest( + PIRP Irp, + CCHAR PriorityBoost) +{ + DPRINT("Completing IRP %p Status %x\n", Irp, Irp->IoStatus.Status); + + ASSERT(Irp->IoStatus.Status != STATUS_PENDING); + + + IoCompleteRequest(Irp, PriorityBoost); +} PVOID AllocateItem( Modified: trunk/reactos/drivers/ksfilter/ks/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/pin.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/pin.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -1875,7 +1875,7 @@ DPRINT1("KsProbeStreamIrp failed with %x\n", Status); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -1888,7 +1888,7 @@ { DPRINT("NoHeader Canceling Irp %p\n", Irp); Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -1911,7 +1911,7 @@ { DPRINT("NoHeader->Data Canceling Irp %p\n", Irp); Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -1960,7 +1960,7 @@ /* invalid device request */ DPRINT("Filter Centric Processing No Process Routine\n"); Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_UNSUCCESSFUL; } @@ -2095,7 +2095,7 @@ if (Status != STATUS_PENDING) { Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); } /* done */ @@ -2135,7 +2135,7 @@ { /* abort closing */ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -2145,7 +2145,7 @@ if (Status != STATUS_PENDING) { Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } } @@ -2162,7 +2162,7 @@ UNIMPLEMENTED; Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; } @@ -2244,7 +2244,7 @@ /* done */ Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return Status; } @@ -2257,7 +2257,7 @@ UNIMPLEMENTED; Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + CompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; } Modified: trunk/reactos/drivers/ksfilter/ks/priv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/priv.h…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/priv.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/priv.h [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -19,6 +19,8 @@ #include "ksmedia.h" #include "bdamedia.h" +#include <swenum.h> + #define TAG_DEVICE_HEADER 'KSDH' #define REG_PINFLAG_B_MANY 0x4 /* strmif.h */ Modified: trunk/reactos/drivers/ksfilter/swenum/swenum.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/swenum/sw…
============================================================================== --- trunk/reactos/drivers/ksfilter/swenum/swenum.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/swenum/swenum.c [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -18,8 +18,56 @@ IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - - UNIMPLEMENTED; + NTSTATUS Status, PnpStatus; + BOOLEAN ChildDevice; + PIO_STACK_LOCATION IoStack; + PDEVICE_OBJECT PnpDeviceObject = NULL; + + /* get current stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* check if the device object is a child device */ + Status = KsIsBusEnumChildDevice(DeviceObject, &ChildDevice); + + /* get bus enum pnp object */ + PnpStatus = KsGetBusEnumPnpDeviceObject(DeviceObject, &PnpDeviceObject); + + /* check for success */ + if (!NT_SUCCESS(Status) || !NT_SUCCESS(PnpStatus)) + { + /* start next power irp */ + PoStartNextPowerIrp(Irp); + + /* just complete the irp */ + Irp->IoStatus.Status = STATUS_SUCCESS; + + /* complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + /* done */ + return STATUS_SUCCESS; + } + + if (IoStack->MinorFunction == IRP_MN_SET_POWER || IoStack->MinorFunction == IRP_MN_QUERY_POWER) + { + /* fake success */ + Irp->IoStatus.Status = STATUS_SUCCESS; + } + + if (!ChildDevice) + { + /* forward to pnp device object */ + PoStartNextPowerIrp(Irp); + + /* skip current location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* done */ + return PoCallDriver(PnpDeviceObject, Irp); + } + + /* start next power irp */ + PoStartNextPowerIrp(Irp); /* just complete the irp */ Irp->IoStatus.Status = STATUS_SUCCESS; @@ -29,7 +77,6 @@ /* done */ return STATUS_SUCCESS; - } NTSTATUS @@ -43,6 +90,9 @@ PIO_STACK_LOCATION IoStack; PDEVICE_OBJECT PnpDeviceObject = NULL; + /* get current stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + /* check if the device object is a child device */ Status = KsIsBusEnumChildDevice(DeviceObject, &ChildDevice); @@ -55,10 +105,30 @@ return Status; } + DPRINT("SwDispatchPnp ChildDevice %u Request %x\n", ChildDevice, IoStack->MinorFunction); + /* let ks handle it */ Status = KsServiceBusEnumPnpRequest(DeviceObject, Irp); - if (!NT_SUCCESS(Status)) + /* check if the request was for a pdo */ + if (!ChildDevice) + { + if (Status != STATUS_NOT_SUPPORTED) + { + /* store result */ + Irp->IoStatus.Status = Status; + } + + /* complete request */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + /* done */ + return Status; + } + + DPRINT("SwDispatchPnp KsServiceBusEnumPnpRequest Status %x\n", Status); + + if (NT_SUCCESS(Status)) { /* invalid request or not supported */ Irp->IoStatus.Status = Status; @@ -69,6 +139,8 @@ /* get bus enum pnp object */ Status = KsGetBusEnumPnpDeviceObject(DeviceObject, &PnpDeviceObject); + DPRINT("SwDispatchPnp KsGetBusEnumPnpDeviceObject Status %x\n", Status); + /* check for success */ if (!NT_SUCCESS(Status)) { @@ -89,11 +161,49 @@ /* delete the device */ IoDeleteDevice(DeviceObject); } - - /* skip current location */ - IoSkipCurrentIrpStackLocation(Irp); - /* call the pnp device object */ - return IoCallDriver(PnpDeviceObject, Irp); + else + { + if (IoStack->MinorFunction == IRP_MN_QUERY_RESOURCES || IoStack->MinorFunction == IRP_MN_QUERY_RESOURCE_REQUIREMENTS) + { + /* no resources required */ + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_SUCCESS; + + /* skip current location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* call the pnp device object */ + return IoCallDriver(PnpDeviceObject, Irp); + } + + if (IoStack->MajorFunction == IRP_MN_QUERY_PNP_DEVICE_STATE) + { + /* device cannot be disabled */ + Irp->IoStatus.Information |= PNP_DEVICE_NOT_DISABLEABLE; + Irp->IoStatus.Status = STATUS_SUCCESS; + + /* skip current location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* call the pnp device object */ + return IoCallDriver(PnpDeviceObject, Irp); + } + + if (Status == STATUS_NOT_SUPPORTED) + { + /* skip current location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* call the pnp device object */ + return IoCallDriver(PnpDeviceObject, Irp); + } + } + + /* complete the request */ + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; } NTSTATUS @@ -149,7 +259,7 @@ IN PIRP Irp) { PIO_STACK_LOCATION IoStack; - NTSTATUS Status = STATUS_SUCCESS; + NTSTATUS Status; /* get current stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); @@ -158,16 +268,25 @@ { /* install interface */ Status = KsInstallBusEnumInterface(Irp); + DPRINT("SwDispatchDeviceControl IOCTL_SWENUM_INSTALL_INTERFACE %x\n", Status); } else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_SWENUM_REMOVE_INTERFACE) { /* remove interface */ Status = KsRemoveBusEnumInterface(Irp); + DPRINT("SwDispatchDeviceControl IOCTL_SWENUM_REMOVE_INTERFACE %x\n", Status); + } else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_SWENUM_GET_BUS_ID) { /* get bus id */ - return KsGetBusEnumIdentifier(Irp); + Status = KsGetBusEnumIdentifier(Irp); + DPRINT("SwDispatchDeviceControl IOCTL_SWENUM_GET_BUS_ID %x\n", Status); + } + else + { + DPRINT("SwDispatchDeviceControl Unknown IOCTL %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode); + Status = STATUS_INVALID_PARAMETER; } /* store result */ @@ -192,6 +311,8 @@ /* check if the device object is a child device */ Status = KsIsBusEnumChildDevice(DeviceObject, &ChildDevice); + + DPRINT("SwDispatchCreate %x\n", Status); /* check for success */ if (NT_SUCCESS(Status)) @@ -205,6 +326,7 @@ } /* perform the create request */ Status = KsServiceBusEnumCreateRequest(DeviceObject, Irp); + DPRINT("SwDispatchCreate %x\n", Status); } /* check the irp is pending */ @@ -245,6 +367,7 @@ NTSTATUS Status; PDEVICE_OBJECT FunctionalDeviceObject; + DPRINT("SWENUM AddDevice\n"); /* create the device */ Status = IoCreateDevice(DriverObject, sizeof(KSDEVICE_HEADER), NULL, FILE_DEVICE_BUS_EXTENDER, 0, FALSE, &FunctionalDeviceObject); @@ -303,7 +426,7 @@ DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = SwDispatchDeviceControl; DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = SwDispatchSystemControl; - + DPRINT("SWENUM loaded\n"); return STATUS_SUCCESS; } Modified: trunk/reactos/drivers/ksfilter/swenum/swenum.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/swenum/sw…
============================================================================== --- trunk/reactos/drivers/ksfilter/swenum/swenum.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/swenum/swenum.rbuild [iso-8859-1] Fri Jan 28 10:37:27 2011 @@ -1,6 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <module name="swenum" type="kernelmodedriver" installbase="system32/drivers" installname="swenum.sys"> + <bootstrap installbase="$(CDOUTPUT)" /> <library>ntoskrnl</library> <library>ks</library> <file>swenum.c</file>
13 years, 11 months
1
0
0
0
[janderwald] 50530: - Remove svn:merge info
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 28 10:27:24 2011 New Revision: 50530 URL:
http://svn.reactos.org/svn/reactos?rev=50530&view=rev
Log: - Remove svn:merge info Modified: trunk/reactos/lib/drivers/sound/ (props changed) Propchange: trunk/reactos/lib/drivers/sound/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo (removed) @@ -1,5 +1,0 @@ -/branches/audio-bringup/lib/drivers/sound:49194-50527 -/branches/header-work/lib/drivers/sound:45691-47721 -/branches/reactos-yarotows/lib/drivers/sound:46372,46848,46966,47800,48026,48064 -/branches/ros-amd64-bringup/lib/drivers/sound:36852 -/branches/ros-amd64-bringup/reactos/lib/drivers/sound:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882
13 years, 11 months
1
0
0
0
[janderwald] 50529: [PSDK] - Merge from audio branch
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 28 10:25:07 2011 New Revision: 50529 URL:
http://svn.reactos.org/svn/reactos?rev=50529&view=rev
Log: [PSDK] - Merge from audio branch Modified: trunk/reactos/include/psdk/ks.h Modified: trunk/reactos/include/psdk/ks.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ks.h?rev=5052…
============================================================================== --- trunk/reactos/include/psdk/ks.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ks.h [iso-8859-1] Fri Jan 28 10:25:07 2011 @@ -1573,11 +1573,6 @@ Properties */ -#define KSPROPERTY_MEMBER_RANGES 0x00000001 -#define KSPROPERTY_MEMBER_STEPPEDRANGES 0x00000002 -#define KSPROPERTY_MEMBER_VALUES 0x00000003 -#define KSPROPERTY_MEMBER_FLAG_DEFAULT KSPROPERTY_MEMBER_RANGES - typedef struct { GUID PropertySet; @@ -1662,6 +1657,17 @@ KSPROPERTY_MEMBERSHEADER MembersHeader; const VOID* Members; } KSPROPERTY_MEMBERSLIST, *PKSPROPERTY_MEMBERSLIST; + +#define KSPROPERTY_MEMBER_RANGES 0x00000001 +#define KSPROPERTY_MEMBER_STEPPEDRANGES 0x00000002 +#define KSPROPERTY_MEMBER_VALUES 0x00000003 + +#define KSPROPERTY_MEMBER_FLAG_DEFAULT 0x00000001 +#if (NTDDI_VERSION >= NTDDI_WINXP) +#define KSPROPERTY_MEMBER_FLAG_BASICSUPPORT_MULTICHANNEL 0x00000002 +#define KSPROPERTY_MEMBER_FLAG_BASICSUPPORT_UNIFORM 0x00000004 +#endif + typedef struct { KSIDENTIFIER PropTypeSet; @@ -2922,6 +2928,232 @@ XP / DX8 */ #if defined(_NTDDK_) + +typedef struct _KSGATE KSGATE, *PKSGATE; + +struct _KSGATE { + LONG Count; + PKSGATE NextGate; +}; + +#ifndef _NTOS_ + +static +void +__inline +KsGateTurnInputOn( + IN PKSGATE Gate OPTIONAL) +{ + while (Gate && (InterlockedIncrement(&Gate->Count) == 1)) + { + Gate = Gate->NextGate; + } +} + +static +void +__inline +KsGateTurnInputOff( + IN PKSGATE Gate OPTIONAL) +{ + while (Gate && (InterlockedDecrement(&Gate->Count) == 0)) + { + Gate = Gate->NextGate; + } +} + +static +BOOLEAN +__inline +KsGateGetStateUnsafe( + IN PKSGATE Gate) +{ + ASSERT(Gate); + return((BOOLEAN)(Gate->Count > 0)); +} + +static +BOOLEAN +__inline +KsGateCaptureThreshold( + IN PKSGATE Gate) +{ + BOOLEAN captured; + + ASSERT(Gate); + + captured = (BOOLEAN)(InterlockedCompareExchange(&Gate->Count,0,1) == 1); + + if (captured) + { + KsGateTurnInputOff(Gate->NextGate); + } + + return captured; +} + +static +void +__inline +KsGateInitialize( + IN PKSGATE Gate, + IN LONG InitialCount, + IN PKSGATE NextGate OPTIONAL, + IN BOOLEAN StateToPropagate + ) +{ + ASSERT(Gate); + Gate->Count = InitialCount; + Gate->NextGate = NextGate; + + if (NextGate) + { + if (InitialCount > 0) + { + if (StateToPropagate) + { + KsGateTurnInputOn(NextGate); + } + } + else + { + if (!StateToPropagate) + { + KsGateTurnInputOff(NextGate); + } + } + } +} + +static +void +__inline +KsGateInitializeAnd( + IN PKSGATE AndGate, + IN PKSGATE NextOrGate OPTIONAL) +{ + KsGateInitialize(AndGate,1,NextOrGate,TRUE); +} + +static +void +__inline +KsGateInitializeOr( + IN PKSGATE OrGate, + IN PKSGATE NextAndGate OPTIONAL) +{ + KsGateInitialize(OrGate,0,NextAndGate,FALSE); +} + +static +void +__inline +KsGateAddOnInputToAnd( + IN PKSGATE AndGate) +{ + UNREFERENCED_PARAMETER (AndGate); +} + +static +void +__inline +KsGateAddOffInputToAnd( + IN PKSGATE AndGate) +{ + KsGateTurnInputOff(AndGate); +} + +static +void +__inline +KsGateRemoveOnInputFromAnd( + IN PKSGATE AndGate) +{ + UNREFERENCED_PARAMETER (AndGate); +} + +static +void +__inline +KsGateRemoveOffInputFromAnd( + IN PKSGATE AndGate) +{ + KsGateTurnInputOn(AndGate); +} + +static +void +__inline +KsGateAddOnInputToOr( + IN PKSGATE OrGate) +{ + KsGateTurnInputOn(OrGate); +} + +static +void +__inline +KsGateAddOffInputToOr( + IN PKSGATE OrGate) +{ + UNREFERENCED_PARAMETER (OrGate); +} + +static +void +__inline +KsGateRemoveOnInputFromOr( + IN PKSGATE OrGate) +{ + KsGateTurnInputOff(OrGate); +} + +static +void +__inline +KsGateRemoveOffInputFromOr( + IN PKSGATE OrGate) +{ + UNREFERENCED_PARAMETER (OrGate); +} + +static +void +__inline +KsGateTerminateAnd( + IN PKSGATE AndGate) +{ + ASSERT(AndGate); + if (KsGateGetStateUnsafe(AndGate)) + { + KsGateRemoveOnInputFromOr(AndGate->NextGate); + } + else + { + KsGateRemoveOffInputFromOr(AndGate->NextGate); + } +} + +static +void +__inline +KsGateTerminateOr( + IN PKSGATE OrGate) +{ + ASSERT(OrGate); + if (KsGateGetStateUnsafe(OrGate)) + { + KsGateRemoveOnInputFromAnd(OrGate->NextGate); + } + else + { + KsGateRemoveOffInputFromAnd(OrGate->NextGate); + } +} + +#endif + + struct _KSMAPPING { PHYSICAL_ADDRESS PhysicalAddress; ULONG ByteCount; @@ -2934,13 +3166,7 @@ KSSTREAM_POINTER_STATE_LOCKED } KSSTREAM_POINTER_STATE; -typedef struct _KSGATE KSGATE, *PKSGATE; typedef struct _KSPROCESSPIN_INDEXENTRY KSPROCESSPIN_INDEXENTRY, *PKSPROCESSPIN_INDEXENTRY; - -struct _KSGATE { - LONG Count; - PKSGATE NextGate; -}; struct _KSSTREAM_POINTER_OFFSET {
13 years, 11 months
1
0
0
0
[janderwald] 50528: [MMEBUDDY] - Merge from audio branch - Handle mixers identified by id, not by handle - Fix opening of mixer devices - Waveformat struct is only provided when type is wave device...
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 28 10:17:01 2011 New Revision: 50528 URL:
http://svn.reactos.org/svn/reactos?rev=50528&view=rev
Log: [MMEBUDDY] - Merge from audio branch - Handle mixers identified by id, not by handle - Fix opening of mixer devices - Waveformat struct is only provided when type is wave device - Implement wave reset routine, fixes audio recording on ReactOS SndRec, AudaCity etc. Also fixes random hang in WinAmp when skipping audio bytes - Implement wave pausing / restarting, should lead to smoother playback [MMIXER] - Merge from audio branch - Tons of fixes to enumeration of mixerlines, controls / etc - Fix mixer event notification callbacks - For more info, read audio-bringup log Added: trunk/reactos/lib/drivers/sound/mmixer/TODO - copied unchanged from r50527, branches/audio-bringup/lib/drivers/sound/mmixer/TODO Modified: trunk/reactos/lib/drivers/sound/ (props changed) trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c trunk/reactos/lib/drivers/sound/mmebuddy/wave/format.c trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c trunk/reactos/lib/drivers/sound/mmixer/controls.c trunk/reactos/lib/drivers/sound/mmixer/midi.c trunk/reactos/lib/drivers/sound/mmixer/mixer.c trunk/reactos/lib/drivers/sound/mmixer/mmixer.h trunk/reactos/lib/drivers/sound/mmixer/priv.h trunk/reactos/lib/drivers/sound/mmixer/sup.c trunk/reactos/lib/drivers/sound/mmixer/topology.c trunk/reactos/lib/drivers/sound/mmixer/wave.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/streaming.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
Modified: trunk/reactos/lib/drivers/sound/mmixer/controls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/c…
Modified: trunk/reactos/lib/drivers/sound/mmixer/midi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/m…
Modified: trunk/reactos/lib/drivers/sound/mmixer/mixer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/m…
Modified: trunk/reactos/lib/drivers/sound/mmixer/mmixer.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/m…
Modified: trunk/reactos/lib/drivers/sound/mmixer/priv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/p…
Modified: trunk/reactos/lib/drivers/sound/mmixer/sup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/s…
Modified: trunk/reactos/lib/drivers/sound/mmixer/topology.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/t…
Modified: trunk/reactos/lib/drivers/sound/mmixer/wave.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/w…
13 years, 11 months
1
0
0
0
[janderwald] 50527: [WINLOGON] - Add msg constants (by smiley)
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 28 09:58:44 2011 New Revision: 50527 URL:
http://svn.reactos.org/svn/reactos?rev=50527&view=rev
Log: [WINLOGON] - Add msg constants (by smiley) Modified: trunk/reactos/include/reactos/winlogon.h Modified: trunk/reactos/include/reactos/winlogon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/winlogon.h…
============================================================================== --- trunk/reactos/include/reactos/winlogon.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/winlogon.h [iso-8859-1] Fri Jan 28 09:58:44 2011 @@ -17,6 +17,14 @@ #define EWX_INTERNAL_KILL_ALL_APPS (EWX_INTERNAL_FLAG | 0x200) #define EWX_INTERNAL_FLAG_LOGOFF 0x1000 +#define WM_LOGONNOTIFY 0x0000004c + +/* WPARAM values for WM_LOGONNOTIFY */ +#define LN_START_TASK_MANAGER 0x4 +#define LN_LOCK_WORKSTATION 0x5 +#define LN_UNLOCK_WORKSTATION 0x6 +#define LN_MESSAGE_BEEP 0x9 + #endif /* REACTOS_WINLOGON_H_INCLUDED */ /* EOF */
13 years, 11 months
1
0
0
0
[janderwald] 50526: [MMIXER_TEST] - Update mmixer tests
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jan 28 09:56:00 2011 New Revision: 50526 URL:
http://svn.reactos.org/svn/reactos?rev=50526&view=rev
Log: [MMIXER_TEST] - Update mmixer tests Modified: trunk/rostests/tests/mmixer_test/mmixer_test.rbuild trunk/rostests/tests/mmixer_test/test.c Modified: trunk/rostests/tests/mmixer_test/mmixer_test.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/tests/mmixer_test/mmixer_…
============================================================================== --- trunk/rostests/tests/mmixer_test/mmixer_test.rbuild [iso-8859-1] (original) +++ trunk/rostests/tests/mmixer_test/mmixer_test.rbuild [iso-8859-1] Fri Jan 28 09:56:00 2011 @@ -8,5 +8,6 @@ <library>winmm</library> <library>mmixer</library> <library>ksuser</library> + <library>user32</library> <file>test.c</file> </module> Modified: trunk/rostests/tests/mmixer_test/test.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/tests/mmixer_test/test.c?…
============================================================================== --- trunk/rostests/tests/mmixer_test/test.c [iso-8859-1] (original) +++ trunk/rostests/tests/mmixer_test/test.c [iso-8859-1] Fri Jan 28 09:56:00 2011 @@ -6,415 +6,214 @@ #include <ksmedia.h> #include <mmsystem.h> #include <mmreg.h> -#include "mmixer.h" - -MIXER_CONTEXT MixerContext; -GUID CategoryGuid = {STATIC_KSCATEGORY_AUDIO}; - -PVOID Alloc(ULONG NumBytes) -{ - //printf("Alloc: %lu\n", NumBytes); - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, NumBytes); -} - -MIXER_STATUS -Close(HANDLE hDevice) -{ - //printf("Close: Handle %p\n", hDevice); - if (CloseHandle(hDevice)) - return MM_STATUS_SUCCESS; - else - return MM_STATUS_UNSUCCESSFUL; + +HMIXER hMixer; +HANDLE hThread; +HWND hwnd; + +DWORD +WINAPI +MixerThread(LPVOID Parameter) +{ + + MSG msg; + + printf("hMixer %p\n", hMixer); + + while(GetMessage(&msg, NULL, 0, 0)) + { + if (msg.message == MM_MIXM_CONTROL_CHANGE) + printf("got MM_MIXM_CONTROL_CHANGE wParam %x lParam %lx\n", msg.wParam, msg.lParam); + else if (msg.message == MM_MIXM_LINE_CHANGE) + printf("got MM_MIXM_LINE_CHANGE wParam %x lParam %lx\n", msg.wParam, msg.lParam); + } + return 1; } VOID -Free(PVOID Block) -{ - //printf("Free: %p\n", Block); - HeapFree(GetProcessHeap(), 0, Block); -} - -VOID -Copy(PVOID Src, PVOID Dst, ULONG NumBytes) -{ - //printf("Copy: Src %p Dst %p NumBytes %lu\n", Src, Dst, NumBytes); - CopyMemory(Src, Dst, NumBytes); -} - -MIXER_STATUS -Open( - IN LPWSTR DevicePath, - OUT PHANDLE hDevice) -{ - DevicePath[1] = L'\\'; - *hDevice = CreateFileW(DevicePath, - GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, - NULL); - if (*hDevice == INVALID_HANDLE_VALUE) +test() +{ + + + hwnd = CreateWindowExA(0, "static", "winmm test", WS_POPUP, 0,0,100,100, + 0, 0, 0, NULL); + + + if (!hwnd) { + printf("failed to create window\n"); + exit(-1); + } + + printf("window created\n"); + + if (mixerOpen(&hMixer, 0, (DWORD_PTR)hwnd, 0, CALLBACK_WINDOW | MIXER_OBJECTF_MIXER) != MMSYSERR_NOERROR) + { + printf("failed to create mixer\n"); + exit(-2); + } + + hThread = CreateThread(NULL, 0, MixerThread, NULL, 0, NULL); + + if (hThread == NULL) + { + printf("failed to create thread\n"); + exit(-3); + } +} + + + + + + +void +printMixerLine(LPMIXERLINEW MixerLine, IN ULONG MixerIndex) +{ + MIXERLINECONTROLSW MixerLineControls; + LPMIXERCONTROLDETAILS_LISTTEXTW ListText; + MIXERCONTROLDETAILS MixerControlDetails; + ULONG Index, SubIndex; + MMRESULT Result; + + printf("\n"); + printf("cChannels %lu\n", MixerLine->cChannels); + printf("cConnections %lu\n", MixerLine->cConnections); + printf("cControls %lu\n", MixerLine->cControls); + printf("dwComponentType %lx\n", MixerLine->dwComponentType); + printf("dwDestination %lu\n", MixerLine->dwDestination); + printf("dwLineID %lx\n", MixerLine->dwLineID); + printf("dwSource %lx\n", MixerLine->dwSource); + printf("dwUser %lu\n", MixerLine->dwUser); + printf("fdwLine %lu\n", MixerLine->fdwLine); + printf("szName %S\n", MixerLine->szName); + printf("szShortName %S\n", MixerLine->szShortName); + printf("Target.dwDeviceId %lu\n", MixerLine->Target.dwDeviceID); + printf("Target.dwType %lu\n", MixerLine->Target.dwType); + printf("Target.szName %S\n", MixerLine->Target.szPname); + printf("Target.vDriverVersion %x\n", MixerLine->Target.vDriverVersion); + printf("Target.wMid %x\n", MixerLine->Target.wMid ); + printf("Target.wPid %x\n", MixerLine->Target.wPid); + + MixerLineControls.cbStruct = sizeof(MixerLineControls); + MixerLineControls.dwLineID = MixerLine->dwLineID; + MixerLineControls.cControls = MixerLine->cControls; + MixerLineControls.cbmxctrl= sizeof(MIXERCONTROLW); + MixerLineControls.pamxctrl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MixerLineControls.cControls * sizeof(MIXERCONTROLW)); + + Result = mixerGetLineControlsW((HMIXEROBJ)MixerIndex, &MixerLineControls, MIXER_GETLINECONTROLSF_ALL | MIXER_OBJECTF_MIXER); + + printf("Result %u\n", Result); + + for(Index = 0; Index < MixerLine->cControls; Index++) { - //wprintf(L" Failed to open %s Error %lu\n", DevicePath, GetLastError()); - return MM_STATUS_UNSUCCESSFUL; - } - wprintf(L"Open: %s hDevice %p\n", DevicePath, *hDevice); - - return MM_STATUS_SUCCESS; -} - -MIXER_STATUS -Control( - IN HANDLE hMixer, - IN ULONG dwIoControlCode, - IN PVOID lpInBuffer, - IN ULONG nInBufferSize, - OUT PVOID lpOutBuffer, - ULONG nOutBufferSize, - PULONG lpBytesReturned) -{ - OVERLAPPED Overlapped; - BOOLEAN IoResult; - DWORD Transferred = 0; - - //printf("hMixer %p dwIoControlCode %lx lpInBuffer %p nInBufferSize %lu lpOutBuffer %p nOutBufferSize %lu lpBytesReturned %p\n", - // hMixer, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned); - - /* Overlapped I/O is done here - this is used for waiting for completion */ - ZeroMemory(&Overlapped, sizeof(OVERLAPPED)); - Overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - - if ( ! Overlapped.hEvent ) - return MM_STATUS_NO_MEMORY; - - /* Talk to the device */ - IoResult = DeviceIoControl(hMixer, - dwIoControlCode, - lpInBuffer, - nInBufferSize, - lpOutBuffer, - nOutBufferSize, - &Transferred, - &Overlapped); - - /* If failure occurs, make sure it's not just due to the overlapped I/O */ - if ( ! IoResult ) - { - if ( GetLastError() != ERROR_IO_PENDING ) + printf("\n"); + printf("Control Index: %lu\n", Index); + printf("\n"); + printf("cbStruct %lu\n", MixerLineControls.pamxctrl[Index].cbStruct); + printf("dwControlID %lu\n", MixerLineControls.pamxctrl[Index].dwControlID); + printf("dwControlType %lx\n", MixerLineControls.pamxctrl[Index].dwControlType); + printf("fdwControl %lu\n", MixerLineControls.pamxctrl[Index].fdwControl); + printf("cMultipleItems %lu\n", MixerLineControls.pamxctrl[Index].cMultipleItems); + printf("szShortName %S\n", MixerLineControls.pamxctrl[Index].szShortName); + printf("szName %S\n", MixerLineControls.pamxctrl[Index].szName); + printf("Bounds.dwMinimum %lu\n", MixerLineControls.pamxctrl[Index].Bounds.dwMinimum); + printf("Bounds.dwMaximum %lu\n", MixerLineControls.pamxctrl[Index].Bounds.dwMaximum); + + printf("Metrics.Reserved[0] %lu\n", MixerLineControls.pamxctrl[Index].Metrics.dwReserved[0]); + printf("Metrics.Reserved[1] %lu\n", MixerLineControls.pamxctrl[Index].Metrics.dwReserved[1]); + printf("Metrics.Reserved[2] %lu\n", MixerLineControls.pamxctrl[Index].Metrics.dwReserved[2]); + printf("Metrics.Reserved[3] %lu\n", MixerLineControls.pamxctrl[Index].Metrics.dwReserved[3]); + printf("Metrics.Reserved[4] %lu\n", MixerLineControls.pamxctrl[Index].Metrics.dwReserved[4]); + printf("Metrics.Reserved[5] %lu\n", MixerLineControls.pamxctrl[Index].Metrics.dwReserved[5]); + + if (MixerLineControls.pamxctrl[Index].dwControlType == MIXERCONTROL_CONTROLTYPE_MUX) { - CloseHandle(Overlapped.hEvent); - - printf("Control: Failed with %lu Transferred %lu\n", GetLastError(), Transferred); - - if (GetLastError() == ERROR_MORE_DATA || GetLastError() == ERROR_INSUFFICIENT_BUFFER) + ZeroMemory(&MixerControlDetails, sizeof(MixerControlDetails)); + MixerControlDetails.cbStruct = sizeof(MIXERCONTROLDETAILS); + MixerControlDetails.cbDetails = sizeof(MIXERCONTROLDETAILS_LISTTEXTW); + MixerControlDetails.cChannels = 1; + MixerControlDetails.cMultipleItems = MixerLineControls.pamxctrl[Index].Metrics.dwReserved[0]; + MixerControlDetails.dwControlID = MixerLineControls.pamxctrl[Index].dwControlID; + MixerControlDetails.paDetails = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MixerControlDetails.cbDetails * MixerControlDetails.cChannels * MixerControlDetails.cMultipleItems); + + Result = mixerGetControlDetailsW((HMIXEROBJ)MixerIndex, &MixerControlDetails, MIXER_GETCONTROLDETAILSF_LISTTEXT | MIXER_OBJECTF_MIXER); + + printf("Result %x\n", Result); + ListText = (LPMIXERCONTROLDETAILS_LISTTEXTW)MixerControlDetails.paDetails; + for(SubIndex = 0; SubIndex < MixerControlDetails.cMultipleItems; SubIndex++) { - if ( lpBytesReturned ) - *lpBytesReturned = Transferred; - return MM_STATUS_MORE_ENTRIES; + printf("dwParam1 %lx\n", ListText[SubIndex].dwParam1); + printf("dwParam1 %lx\n", ListText[SubIndex].dwParam2); + printf("szName %S\n", ListText[SubIndex].szName); } - return MM_STATUS_UNSUCCESSFUL; + MixerControlDetails.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN); + MixerControlDetails.paDetails = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MIXERCONTROLDETAILS_BOOLEAN) * MixerControlDetails.cMultipleItems); + ((LPMIXERCONTROLDETAILS_BOOLEAN)MixerControlDetails.paDetails)->fValue = TRUE; + + Result = mixerSetControlDetails((HMIXEROBJ)hMixer, &MixerControlDetails, MIXER_SETCONTROLDETAILSF_VALUE | MIXER_OBJECTF_HANDLE); + printf("Result %x hMixer %p\n", Result, hMixer); } } - - /* Wait for the I/O to complete */ - IoResult = GetOverlappedResult(hMixer, - &Overlapped, - &Transferred, - TRUE); - - /* Don't need this any more */ - CloseHandle(Overlapped.hEvent); - - if ( ! IoResult ) - return MM_STATUS_UNSUCCESSFUL; - - //printf("Transferred %lu bytes in Sync overlapped I/O\n", Transferred); - - if ( lpBytesReturned ) - *lpBytesReturned = Transferred; - - return MM_STATUS_SUCCESS; -} - -MIXER_STATUS -Enum( - IN PVOID EnumContext, - IN ULONG DeviceIndex, - OUT LPWSTR * DeviceName, - OUT PHANDLE OutHandle, - OUT PHANDLE OutKey) -{ - SP_DEVICE_INTERFACE_DATA InterfaceData; - SP_DEVINFO_DATA DeviceData; - PSP_DEVICE_INTERFACE_DETAIL_DATA_W DetailData; - BOOL Result; - DWORD Length; - MIXER_STATUS Status; - - //printf("Enum EnumContext %p DeviceIndex %lu OutHandle %p\n", EnumContext, DeviceIndex, OutHandle); - - InterfaceData.cbSize = sizeof(InterfaceData); - InterfaceData.Reserved = 0; - - Result = SetupDiEnumDeviceInterfaces(EnumContext, - NULL, - &CategoryGuid, - DeviceIndex, - &InterfaceData); - - if (!Result) +} + +int main(int argc, char**argv) +{ + DWORD MixerCount, MixerIndex, DestinationIndex, SrcIndex; + MIXERCAPSW MixerCaps; + MIXERLINEW DstMixerLine, SrcLine; + MMRESULT Result; + + +test(); + + MixerCount = mixerGetNumDevs(); + + printf("MixerCount %lu\n", MixerCount); + + for(MixerIndex = 0; MixerIndex < MixerCount; MixerIndex++) { - if (GetLastError() == ERROR_NO_MORE_ITEMS) + Result = mixerGetDevCapsW((UINT_PTR)MixerIndex, &MixerCaps, sizeof(MixerCaps)); + + printf("\n"); + printf("Index %lu Result %x\n", MixerIndex, Result); + printf("Name :%S\n", MixerCaps.szPname); + printf("cDestinations: %lu\n", MixerCaps.cDestinations); + printf("fdwSupport %lx\n", MixerCaps.fdwSupport); + printf("vDriverVersion %x\n", MixerCaps.vDriverVersion); + printf("wMid %x\n", MixerCaps.wMid); + printf("wPid %x\n", MixerCaps.wPid); + + for(DestinationIndex = 0; DestinationIndex < MixerCaps.cDestinations; DestinationIndex++) { - printf("LastDevice\n"); - return MM_STATUS_NO_MORE_DEVICES; + ZeroMemory(&DstMixerLine, sizeof(DstMixerLine)); + DstMixerLine.dwDestination = DestinationIndex; + DstMixerLine.cbStruct = sizeof(DstMixerLine); + + Result = mixerGetLineInfoW((HMIXEROBJ)MixerIndex, &DstMixerLine, MIXER_GETLINEINFOF_DESTINATION | MIXER_OBJECTF_MIXER); + printf("\n"); + printf("Destination Index %lu\n", DestinationIndex); + printMixerLine(&DstMixerLine, MixerIndex); + for(SrcIndex = 0; SrcIndex < DstMixerLine.cConnections; SrcIndex++) + { + ZeroMemory(&SrcLine, sizeof(SrcLine)); + SrcLine.dwDestination = DestinationIndex; + SrcLine.dwSource = SrcIndex; + SrcLine.cbStruct = sizeof(SrcLine); + + Result = mixerGetLineInfoW((HMIXEROBJ)MixerIndex, &SrcLine, MIXER_GETLINEINFOF_SOURCE | MIXER_OBJECTF_MIXER); + + if (Result == MMSYSERR_NOERROR) + { + printf("\n"); + printf("SrcLineIndex %lu\n", SrcIndex); + printMixerLine(&SrcLine, MixerIndex); + } + } } - printf("SetupDiEnumDeviceInterfaces failed with %lu\n", GetLastError()); - return MM_STATUS_UNSUCCESSFUL; } - - Length = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W) + MAX_PATH * sizeof(WCHAR); - DetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA_W)HeapAlloc(GetProcessHeap(), - 0, - Length); - DetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W); - DeviceData.cbSize = sizeof(DeviceData); - DeviceData.Reserved = 0; - - Result = SetupDiGetDeviceInterfaceDetailW(EnumContext, - &InterfaceData, - DetailData, - Length, - NULL, - &DeviceData); - - if (!Result) - { - printf("SetupDiGetDeviceInterfaceDetailW failed with %lu\n", GetLastError()); - return MM_STATUS_UNSUCCESSFUL; - } - - - *OutKey = SetupDiOpenDeviceInterfaceRegKey(EnumContext, &InterfaceData, 0, KEY_READ); - if ((HKEY)*OutKey == INVALID_HANDLE_VALUE) - { - printf("SetupDiOpenDeviceInterfaceRegKey failed with %lx\n", GetLastError()); - HeapFree(GetProcessHeap(), 0, DetailData); - return MM_STATUS_UNSUCCESSFUL; - } - - Status = Open(DetailData->DevicePath, OutHandle); - - if (Status != MM_STATUS_SUCCESS) - { - RegCloseKey((HKEY)*OutKey); - HeapFree(GetProcessHeap(), 0, DetailData); - return Status; - } - - *DeviceName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (wcslen(DetailData->DevicePath)+1) * sizeof(WCHAR)); - if (*DeviceName == NULL) - { - CloseHandle(*OutHandle); - RegCloseKey((HKEY)*OutKey); - HeapFree(GetProcessHeap(), 0, DetailData); - return MM_STATUS_NO_MEMORY; - } - - wcscpy(*DeviceName, DetailData->DevicePath); - HeapFree(GetProcessHeap(), 0, DetailData); - - return Status; -} - -MIXER_STATUS -QueryKeyValue( - IN HANDLE hKey, - IN LPWSTR KeyName, - OUT PVOID * ResultBuffer, - OUT PULONG ResultLength, - OUT PULONG KeyType) -{ - if (RegQueryValueExW((HKEY)hKey, KeyName, NULL, KeyType, NULL, ResultLength) == ERROR_FILE_NOT_FOUND) - return MM_STATUS_UNSUCCESSFUL; - - *ResultBuffer = HeapAlloc(GetProcessHeap(), 0, *ResultLength); - if (*ResultBuffer == NULL) - return MM_STATUS_NO_MEMORY; - - if (RegQueryValueExW((HKEY)hKey, KeyName, NULL, KeyType, *ResultBuffer, ResultLength) != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, *ResultBuffer); - return MM_STATUS_UNSUCCESSFUL; - } - return MM_STATUS_SUCCESS; -} - -MIXER_STATUS -OpenKey( - IN HANDLE hKey, - IN LPWSTR SubKey, - IN ULONG DesiredAccess, - OUT PHANDLE OutKey) -{ - if (RegOpenKeyExW((HKEY)hKey, SubKey, 0, DesiredAccess, (PHKEY)OutKey) == ERROR_SUCCESS) - return MM_STATUS_SUCCESS; - - return MM_STATUS_UNSUCCESSFUL; -} - -MIXER_STATUS -CloseKey( - IN HANDLE hKey) -{ - RegCloseKey((HKEY)hKey); - return MM_STATUS_SUCCESS; -} - -PVOID -AllocEventData( - IN ULONG ExtraSize) -{ - PKSEVENTDATA Data = (PKSEVENTDATA)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(KSEVENTDATA) + ExtraSize); - if (!Data) - return NULL; - - Data->EventHandle.Event = CreateEventW(NULL, FALSE, FALSE, NULL); - if (!Data->EventHandle.Event) - { - HeapFree(GetProcessHeap(), 0, Data); - return NULL; - } - - Data->NotificationType = KSEVENTF_EVENT_HANDLE; - return Data; -} - -VOID -FreeEventData(IN PVOID EventData) -{ - PKSEVENTDATA Data = (PKSEVENTDATA)EventData; - - CloseHandle(Data->EventHandle.Event); - HeapFree(GetProcessHeap(), 0, Data); -} - -int main(int argc, char**argv) -{ - MIXER_STATUS Status; - HDEVINFO DeviceHandle; - MIXERCAPSW MixCaps1, MixCaps2; - ULONG Index, SubIndex; - HANDLE hMixer2; - HMIXER hMixer1; - MIXERLINEW MixerLine1, MixerLine2; - MIXERLINECONTROLSW Controls1, Controls2; - - ZeroMemory(&MixerContext, sizeof(MIXER_CONTEXT)); - - DeviceHandle = SetupDiGetClassDevs(&CategoryGuid, - NULL, - NULL, - DIGCF_DEVICEINTERFACE/*|DIGCF_PRESENT */); - if (DeviceHandle == INVALID_HANDLE_VALUE) - { - printf("SetupDiGetClassDevs failed with %lx\n", GetLastError()); - return 0; - } - - printf("DeviceHandle %p\n", DeviceHandle); - - MixerContext.SizeOfStruct = sizeof(MIXER_CONTEXT); - MixerContext.Alloc = Alloc; - MixerContext.Close = Close; - MixerContext.Control = Control; - MixerContext.Copy = Copy; - MixerContext.Free = Free; - MixerContext.Open = Open; - MixerContext.OpenKey = OpenKey; - MixerContext.CloseKey = CloseKey; - MixerContext.QueryKeyValue = QueryKeyValue; - MixerContext.AllocEventData = AllocEventData; - MixerContext.FreeEventData = FreeEventData; - - Status = MMixerInitialize(&MixerContext, Enum, (PVOID)DeviceHandle); - - printf("Status %x\n", Status); - printf("NumberOfMixers %lu mixerGetNumDevs %u\n", MMixerGetCount(&MixerContext), mixerGetNumDevs()); - - for(Index = 0; Index < MMixerGetCount(&MixerContext); Index++) - { - mixerGetDevCapsW(Index, &MixCaps1, sizeof(MIXERCAPSW)); - wprintf(L"WINM: cDestination %u fdwSupport %lx szPname %s vDriverVersion %u wMid %x wPid %x\n", MixCaps1.cDestinations, MixCaps1.fdwSupport, MixCaps1.szPname, MixCaps1.vDriverVersion, MixCaps1.wMid, MixCaps1.wPid); - MMixerGetCapabilities(&MixerContext, Index, &MixCaps2); - wprintf(L"MMIX: cDestination %u fdwSupport %lx szPname %s vDriverVersion %u wMid %x wPid %x\n", MixCaps2.cDestinations, MixCaps2.fdwSupport, MixCaps2.szPname, MixCaps2.vDriverVersion, MixCaps2.wMid, MixCaps2.wPid); - - mixerOpen(&hMixer1, Index, 0, 0, MIXER_OBJECTF_HMIXER); - MMixerOpen(&MixerContext, Index, NULL, NULL, &hMixer2); - - ZeroMemory(&MixerLine1, sizeof(MIXERLINEW)); - ZeroMemory(&MixerLine2, sizeof(MIXERLINEW)); - MixerLine1.cbStruct = sizeof(MIXERLINEW); - MixerLine2.cbStruct = sizeof(MIXERLINEW); - mixerGetLineInfoW((HMIXEROBJ)hMixer1, &MixerLine1, MIXER_GETLINEINFOF_DESTINATION); - MMixerGetLineInfo(&MixerContext, hMixer2, MIXER_GETLINEINFOF_DESTINATION, &MixerLine2); - - wprintf(L"WINM: dwDestination %lx dwSource %lx dwLineID %lx dwUser %lx dwComponentType %lx cChannels %lx cConnections %lx cControls %lx szShortName %s szName %s\n\n", - MixerLine1.dwDestination, MixerLine1.dwSource, MixerLine1.dwLineID, MixerLine1.dwUser, MixerLine1.dwComponentType, MixerLine1.cChannels, MixerLine1.cConnections, MixerLine1.cControls, MixerLine1.szShortName, MixerLine1.szName); - - wprintf(L"MMIX: dwDestination %lx dwSource %lx dwLineID %lx dwUser %lx dwComponentType %lx cChannels %lx cConnections %lx cControls %lx szShortName %s szName %s\n\n", - MixerLine2.dwDestination, MixerLine2.dwSource, MixerLine2.dwLineID, MixerLine2.dwUser, MixerLine2.dwComponentType, MixerLine2.cChannels, MixerLine2.cConnections, MixerLine2.cControls, MixerLine2.szShortName, MixerLine2.szName); - - Controls1.cbStruct = sizeof(MIXERLINECONTROLSW); - Controls2.cbStruct = sizeof(MIXERLINECONTROLSW); - - Controls1.cbmxctrl = sizeof(MIXERCONTROL); - Controls2.cbmxctrl = sizeof(MIXERCONTROL); - - Controls1.cControls = MixerLine1.cControls; - Controls2.cControls = MixerLine2.cControls; - - Controls1.dwLineID = MixerLine1.dwLineID; - Controls2.dwLineID = MixerLine2.dwLineID; - - - - Controls1.pamxctrl = (LPMIXERCONTROLW)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MIXERCONTROLW) * Controls1.cControls); - Controls2.pamxctrl = (LPMIXERCONTROLW)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MIXERCONTROLW) * Controls2.cControls); - - for(SubIndex = 0; SubIndex < Controls1.cControls; SubIndex++) - Controls1.pamxctrl[SubIndex].cbStruct = sizeof(MIXERCONTROLW); - - for(SubIndex = 0; SubIndex < Controls2.cControls; SubIndex++) - Controls2.pamxctrl[SubIndex].cbStruct = sizeof(MIXERCONTROLW); - - mixerGetLineControlsW((HMIXEROBJ)hMixer1, &Controls1, MIXER_GETLINECONTROLSF_ALL); - MMixerGetLineControls(&MixerContext, hMixer2, MIXER_GETLINECONTROLSF_ALL, &Controls2); - - wprintf(L"----------------------------------------\n"); - for(SubIndex = 0; SubIndex < Controls1.cControls || SubIndex < Controls2.cControls; SubIndex++) - { - if (SubIndex < Controls1.cControls) - { - wprintf(L"WINM: Index %d dwControlID %lx dwControlType %lx fdwControl %lx cMultipleItems %lx szName %s szShortName %s \n", SubIndex, Controls1.pamxctrl[SubIndex].dwControlID, Controls1.pamxctrl[SubIndex].dwControlType, Controls1.pamxctrl[SubIndex].fdwControl, Controls1.pamxctrl[SubIndex].cMultipleItems, Controls1.pamxctrl[SubIndex].szName, Controls1.pamxctrl[SubIndex].szShortName); - } - - if (SubIndex < Controls2.cControls) - { - wprintf(L"MMIX: Index %d dwControlID %lx dwControlType %lx fdwControl %lx cMultipleItems %lx szName %s szShortName %s \n", SubIndex, Controls2.pamxctrl[SubIndex].dwControlID, Controls2.pamxctrl[SubIndex].dwControlType, Controls2.pamxctrl[SubIndex].fdwControl, Controls2.pamxctrl[SubIndex].cMultipleItems, Controls2.pamxctrl[SubIndex].szName, Controls2.pamxctrl[SubIndex].szShortName); - } - - } - wprintf(L"----------------------------------------\n"); - - - wprintf(L"=======================\n"); - } - - wprintf(L"//////////////////////\n"); - wprintf(L"NumWaveOut %lu NumWaveIn %lu\n", MMixerGetWaveOutCount(&MixerContext), MMixerGetWaveInCount(&MixerContext)); - wprintf(L"waveOut %lu waveIn %lu\n", waveOutGetNumDevs(), waveInGetNumDevs()); +WaitForSingleObject(hThread, INFINITE); +CloseHandle(hThread); + return 0; }
13 years, 11 months
1
0
0
0
[akhaldi] 50525: [CMAKE] - The suffix variable already holds a dot, don't add another one. Fixes import libs generation.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Jan 28 09:31:54 2011 New Revision: 50525 URL:
http://svn.reactos.org/svn/reactos?rev=50525&view=rev
Log: [CMAKE] - The suffix variable already holds a dot, don't add another one. Fixes import libs generation. Modified: branches/cmake-bringup/gcc.cmake branches/cmake-bringup/msc.cmake Modified: branches/cmake-bringup/gcc.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=505…
============================================================================== --- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Fri Jan 28 09:31:54 2011 @@ -274,7 +274,7 @@ add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a - COMMAND native-spec2def -n=${_name}.${_suffix} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}_implib.def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file} + COMMAND native-spec2def -n=${_name}${_suffix} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}_implib.def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file} COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_BINARY_DIR}/${_name}_implib.def --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}) Modified: branches/cmake-bringup/msc.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=505…
============================================================================== --- branches/cmake-bringup/msc.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/msc.cmake [iso-8859-1] Fri Jan 28 09:31:54 2011 @@ -143,7 +143,7 @@ # Generate the asm stub file and the export def file add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def - COMMAND native-spec2def --ms --kill-at -r -n=${_name}.${_suffix} -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file} + COMMAND native-spec2def --ms --kill-at -r -n=${_name}${_suffix} -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}) # Assemble the stub file
13 years, 11 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
34
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
Results per page:
10
25
50
100
200