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
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2007
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
589 discussions
Start a n
N
ew thread
[silverblade] 29109: Fix EOL style (I think!)
by silverblade@svn.reactos.org
Author: silverblade Date: Wed Sep 19 23:25:43 2007 New Revision: 29109 URL:
http://svn.reactos.org/svn/reactos?rev=29109&view=rev
Log: Fix EOL style (I think!) Modified: trunk/reactos/base/services/audiosrv/debug.c (props changed) trunk/reactos/base/services/audiosrv/main.c Propchange: trunk/reactos/base/services/audiosrv/debug.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/services/
…
[View More]
audiosrv/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/mai…
============================================================================== --- trunk/reactos/base/services/audiosrv/main.c (original) +++ trunk/reactos/base/services/audiosrv/main.c Wed Sep 19 23:25:43 2007 @@ -23,6 +23,17 @@ SERVICE_STATUS_HANDLE service_status_handle; SERVICE_STATUS service_status; + +/* This is for testing only! */ +VOID +InitializeFakeDevice() +{ + PnP_AudioDevice* list_node; + + list_node = CreateDeviceDescriptor(L"ThisDeviceDoesNotReallyExist", TRUE); + AppendAudioDeviceToList(list_node); + DestroyDeviceDescriptor(list_node); +} DWORD WINAPI ServiceControlHandler( @@ -86,7 +97,11 @@ NULL); logmsg("Service status handle %d\n", service_status_handle); - /* TODO: Deal with errors */ + if ( ! service_status_handle ) + { + logmsg("Failed to register service control handler\n"); + /* FIXME - we should fail */ + } /* Set these to defaults */ service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; @@ -127,6 +142,8 @@ */ } + InitializeFakeDevice(); + logmsg("Processing existing devices\n"); /* Now find any devices that already exist on the system */ if ( ! ProcessExistingDevices() )
[View Less]
17 years, 9 months
1
0
0
0
[silverblade] 29108: Set service to manual start, and implemented a quick debug-logging solution. ReactOS does not currently have RegisterDeviceNotification implemented so if this function fails the audio service will still run but won't receive plug and play event notifications (this is a temporary hack.) Service now starts but won't find any devices (we don't have any yet!)
by silverblade@svn.reactos.org
Author: silverblade Date: Wed Sep 19 20:54:25 2007 New Revision: 29108 URL:
http://svn.reactos.org/svn/reactos?rev=29108&view=rev
Log: Set service to manual start, and implemented a quick debug-logging solution. ReactOS does not currently have RegisterDeviceNotification implemented so if this function fails the audio service will still run but won't receive plug and play event notifications (this is a temporary hack.) Service now starts but won't find any devices (we don't have any yet!)
…
[View More]
Added: trunk/reactos/base/services/audiosrv/debug.c (with props) Modified: trunk/reactos/base/services/audiosrv/audiosrv.h trunk/reactos/base/services/audiosrv/audiosrv.rbuild (contents, props changed) trunk/reactos/base/services/audiosrv/audiosrv.rc (props changed) trunk/reactos/base/services/audiosrv/audiosrv.txt (contents, props changed) trunk/reactos/base/services/audiosrv/main.c (contents, props changed) trunk/reactos/base/services/audiosrv/pnp.c (contents, props changed) trunk/reactos/base/services/audiosrv/pnp_list_lock.c (props changed) trunk/reactos/base/services/audiosrv/pnp_list_manager.c (contents, props changed) trunk/reactos/boot/bootdata/hivesys.inf trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/base/services/audiosrv/audiosrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/aud…
============================================================================== --- trunk/reactos/base/services/audiosrv/audiosrv.h (original) +++ trunk/reactos/base/services/audiosrv/audiosrv.h Wed Sep 19 20:54:25 2007 @@ -61,4 +61,9 @@ DWORD dwEventType, LPVOID lpEventData); + +/* Debugging */ + +void logmsg(char* string, ...); + #endif Modified: trunk/reactos/base/services/audiosrv/audiosrv.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/aud…
============================================================================== --- trunk/reactos/base/services/audiosrv/audiosrv.rbuild (original) +++ trunk/reactos/base/services/audiosrv/audiosrv.rbuild Wed Sep 19 20:54:25 2007 @@ -14,5 +14,6 @@ <file>pnp_list_manager.c</file> <file>pnp_list_lock.c</file> <file>pnp.c</file> + <file>debug.c</file> <file>audiosrv.rc</file> </module> Propchange: trunk/reactos/base/services/audiosrv/audiosrv.rbuild ------------------------------------------------------------------------------ eol-style:native = base/services/audiosrv/audiosrv.h Propchange: trunk/reactos/base/services/audiosrv/audiosrv.rc ------------------------------------------------------------------------------ eol-style:native = base/services/audiosrv/audiosrv.h Modified: trunk/reactos/base/services/audiosrv/audiosrv.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/aud…
============================================================================== --- trunk/reactos/base/services/audiosrv/audiosrv.txt (original) +++ trunk/reactos/base/services/audiosrv/audiosrv.txt Wed Sep 19 20:54:25 2007 @@ -9,6 +9,9 @@ AudioSrv on Windows creates a mapped file at: Global\mmGlobalPnpInfo + +The ReactOS audio device list lives at: +Global\AudioDeviceList This file appears to contain a list of devices that WinMM accesses and subsequently passes to wdmaud.drv @@ -32,7 +35,39 @@ it should be possible to create a small application that imitates WinMM's actions :) -So far, it doesn't do much... Watch this space! + +Current Status +============== + +AudioSrv registers for device notifications and obtains a list of the +current audio devices in the system (devices registered against the +KSCATEGORY_AUDIO interface). + +ReactOS does not currently have RegisterDeviceNotification implemented, +so for the moment this service considers the failure of this API call +to be non-fatal and will proceed without device event notification. This +behaviour will be amended in a future revision (ie once this API call +is implemented!) + + +Testing the Service +=================== + +The service can be installed on Windows XP (possibly also Vista) like so: +sc create RosAudioSrv <path to audiosrv.exe> +net start RosAudioSrv + +...and can be removed like so: +net stop RosAudioSrv +sc delete RosAudioSrv + +You can view a list of the currently available devices (device list is +identical to the one offered by Windows' own AudioSrv) by running +my READER.EXE test utility, available in the following package: + +http://stuff.silverblade.co.uk/reactos/sharedlist.tar.gz + +That's all for now, folks ;) Andrew Greenwood Propchange: trunk/reactos/base/services/audiosrv/audiosrv.txt ------------------------------------------------------------------------------ eol-style:native = base/services/audiosrv/audiosrv.h Added: trunk/reactos/base/services/audiosrv/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/deb…
============================================================================== --- trunk/reactos/base/services/audiosrv/debug.c (added) +++ trunk/reactos/base/services/audiosrv/debug.c Wed Sep 19 20:54:25 2007 @@ -1,0 +1,19 @@ +/* Service debugging (simply logs to a file) */ + +#include <stdio.h> +#include <stdarg.h> + +void logmsg(char* string, ...) +{ + va_list args; + + FILE* debug_file = fopen("c:\\audiosrv-debug.txt", "a"); + + va_start(args, string); + + vfprintf(debug_file, string, args); + + va_end(args); + + fclose(debug_file); +} Propchange: trunk/reactos/base/services/audiosrv/debug.c ------------------------------------------------------------------------------ eol-style:native = base/services/audiosrv/audiosrv.h Modified: trunk/reactos/base/services/audiosrv/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/mai…
============================================================================== --- trunk/reactos/base/services/audiosrv/main.c (original) +++ trunk/reactos/base/services/audiosrv/main.c Wed Sep 19 20:54:25 2007 @@ -35,13 +35,19 @@ { case SERVICE_CONTROL_INTERROGATE : { + logmsg("* Interrogation\n"); return NO_ERROR; } case SERVICE_CONTROL_STOP : case SERVICE_CONTROL_SHUTDOWN : { + logmsg("* Service Stop/Shutdown request received\n"); + + logmsg("Unregistering device notifications\n"); UnregisterDeviceNotifications(); + + logmsg("Destroying audio device list\n"); DestroyAudioDeviceList(); service_status.dwCurrentState = SERVICE_STOP_PENDING; @@ -52,11 +58,14 @@ SetServiceStatus(service_status_handle, &service_status); + logmsg("* Service stopped\n"); + return NO_ERROR; } case SERVICE_CONTROL_DEVICEEVENT : { + logmsg("* Device Event\n"); return HandleDeviceEvent(dwEventType, lpEventData); } @@ -70,9 +79,14 @@ VOID CALLBACK ServiceMain(DWORD argc, char** argv) { + logmsg("* Service starting\n"); + logmsg("Registering service control handler...\n"); service_status_handle = RegisterServiceCtrlHandlerEx(SERVICE_NAME, ServiceControlHandler, NULL); + + logmsg("Service status handle %d\n", service_status_handle); + /* TODO: Deal with errors */ /* Set these to defaults */ service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; @@ -86,29 +100,38 @@ service_status.dwCurrentState = SERVICE_START_PENDING; SetServiceStatus(service_status_handle, &service_status); + logmsg("Creating audio device list\n"); /* This creates the audio device list and mutex */ if ( ! CreateAudioDeviceList(AUDIO_LIST_MAX_SIZE) ) { + logmsg("Failed to create audio device list\n"); service_status.dwCurrentState = SERVICE_STOPPED; service_status.dwWin32ExitCode = -1; SetServiceStatus(service_status_handle, &service_status); return; } + logmsg("Registering for device notifications\n"); /* We want to know when devices are added/removed */ if ( ! RegisterForDeviceNotifications() ) { + /* FIXME: This is not fatal at present as ROS does not support this */ + logmsg("Failed to register for device notifications\n"); +/* DestroyAudioDeviceList(); service_status.dwCurrentState = SERVICE_STOPPED; service_status.dwWin32ExitCode = -1; SetServiceStatus(service_status_handle, &service_status); return; +*/ } + logmsg("Processing existing devices\n"); /* Now find any devices that already exist on the system */ if ( ! ProcessExistingDevices() ) { + logmsg("Could not process existing devices\n"); UnregisterDeviceNotifications(); DestroyAudioDeviceList(); @@ -118,6 +141,7 @@ return; } + logmsg("* Service started"); /* Tell SCM we are now running, and we may be stopped */ service_status.dwCurrentState = SERVICE_RUNNING; service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP; @@ -126,6 +150,7 @@ int main() { + logmsg("Audio Service main()\n"); StartServiceCtrlDispatcher(service_table); return 0; } Propchange: trunk/reactos/base/services/audiosrv/main.c ------------------------------------------------------------------------------ eol-style:native = base/services/audiosrv/audiosrv.h Modified: trunk/reactos/base/services/audiosrv/pnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/pnp…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp.c (original) +++ trunk/reactos/base/services/audiosrv/pnp.c Wed Sep 19 20:54:25 2007 @@ -127,7 +127,6 @@ const GUID wdmaud_guid = {STATIC_KSCATEGORY_AUDIO}; - /* FIXME: This currently lists ALL device interfaces... */ ZeroMemory(¬ification_filter, sizeof(notification_filter)); notification_filter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE); notification_filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; @@ -139,6 +138,11 @@ DEVICE_NOTIFY_SERVICE_HANDLE /* | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES*/); + + if ( ! device_notification_handle ) + { + logmsg("RegisterDeviceNotification() failed with error %d\n", GetLastError()); + } return ( device_notification_handle != NULL ); } @@ -152,7 +156,12 @@ VOID UnregisterDeviceNotifications() { /* TODO -- NOT IMPLEMENTED! */ - device_notification_handle = NULL; + + if ( device_notification_handle ) + { + /* TODO */ + device_notification_handle = NULL; + } } Propchange: trunk/reactos/base/services/audiosrv/pnp.c ------------------------------------------------------------------------------ eol-style:native = base/services/audiosrv/audiosrv.h Propchange: trunk/reactos/base/services/audiosrv/pnp_list_lock.c ------------------------------------------------------------------------------ eol-style:native = base/services/audiosrv/audiosrv.h Modified: trunk/reactos/base/services/audiosrv/pnp_list_manager.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/pnp…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp_list_manager.c (original) +++ trunk/reactos/base/services/audiosrv/pnp_list_manager.c Wed Sep 19 20:54:25 2007 @@ -8,6 +8,7 @@ #include <assert.h> #include <audiosrv/audiosrv.h> +#include "audiosrv.h" /* @@ -27,7 +28,10 @@ device = malloc(size); if ( ! device ) + { + log("Failed to create a device descriptor (malloc fail)\n"); return NULL; + } device->enabled = is_enabled; memcpy(device->path, path, path_length); @@ -72,9 +76,7 @@ /* We DON'T want to overshoot the end of the buffer! */ if ( audio_device_list->size + device_info_size > audio_device_list->max_size ) { -/* - printf("max_size would be exceeded! failing\n"); -*/ + printf("max_size would be exceeded! Failing...\n"); return FALSE; } @@ -88,6 +90,8 @@ audio_device_list->size += device_info_size; UnlockAudioDeviceList(); + + log("Device added to list\n"); return TRUE; } @@ -108,6 +112,7 @@ turning up before we're ready... */ LockAudioDeviceList(); + log("Creating file mapping\n"); /* Expose our device list to the world */ device_list_file = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, @@ -118,7 +123,7 @@ if ( ! device_list_file ) { - /*printf("Creation of audio device list FAILED!\n");*/ + log("Creation of audio device list failed (err %d)\n", GetLastError()); UnlockAudioDeviceList(); KillAudioDeviceListLock(); @@ -126,6 +131,7 @@ return FALSE; } + log("Mapping view of file\n"); /* Of course, we'll need to access the list ourselves */ audio_device_list = MapViewOfFile(device_list_file, FILE_MAP_WRITE, @@ -135,7 +141,7 @@ if ( ! audio_device_list ) { - /*printf("MapViewOfFile FAILED\n");*/ + log("MapViewOfFile FAILED (err %d)\n", GetLastError()); CloseHandle(device_list_file); device_list_file = NULL; @@ -156,12 +162,16 @@ UnlockAudioDeviceList(); + log("Device list created\n"); + return TRUE; } VOID DestroyAudioDeviceList() { + log("Destroying device list\n"); + LockAudioDeviceList(); /*printf("Unmapping view\n");*/ Propchange: trunk/reactos/base/services/audiosrv/pnp_list_manager.c ------------------------------------------------------------------------------ eol-style:native = base/services/audiosrv/audiosrv.h Modified: trunk/reactos/boot/bootdata/hivesys.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys.inf (original) +++ trunk/reactos/boot/bootdata/hivesys.inf Wed Sep 19 20:54:25 2007 @@ -480,6 +480,15 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Atapi","Type",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\Atapi","Tag",0x00010001,0x00000010 +; Audio Service +HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","DisplayName",0x00000000,"Audio Service" +HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","Description",0x00000000,"Provides audio facilities to applications" +HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","ErrorControl",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","Group",0x00000000,"Audio" +HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","ImagePath",0x00020000,"%SystemRoot%\system32\audiosrv.exe" +HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","Start",0x00010001,0x00000003 +HKLM,"SYSTEM\CurrentControlSet\Services\AudioSrv","Type",0x00010001,0x00000010 + ; BusLogic 958 miniport driver HKLM,"SYSTEM\CurrentControlSet\Services\BusLogic","ErrorControl",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\BusLogic","Group",0x00000000,"SCSI Miniport" Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff Wed Sep 19 20:54:25 2007 @@ -75,6 +75,7 @@ base\services\tcpsvcs\tcpsvcs.exe 1 base\services\tcpsvcs\quotes 5 base\services\umpnpmgr\umpnpmgr.exe 1 +base\services\audiosrv\audiosrv.exe 1 base\setup\setup\setup.exe 1 base\setup\vmwinst\vmwinst.exe 1
[View Less]
17 years, 9 months
1
0
0
0
[hpoussin] 29107: Add missing svn:eol-style=native property
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Sep 19 19:18:05 2007 New Revision: 29107 URL:
http://svn.reactos.org/svn/reactos?rev=29107&view=rev
Log: Add missing svn:eol-style=native property Modified: trunk/reactos/base/services/audiosrv/audiosrv.h (props changed) trunk/reactos/base/services/audiosrv/audiosrv.rbuild (props changed) trunk/reactos/base/services/audiosrv/audiosrv.txt (props changed) trunk/reactos/base/services/audiosrv/main.c (contents, props changed) trunk/
…
[View More]
reactos/base/services/audiosrv/pnp.c (props changed) trunk/reactos/base/services/audiosrv/pnp_list_lock.c (props changed) trunk/reactos/base/services/audiosrv/pnp_list_manager.c (props changed) Propchange: trunk/reactos/base/services/audiosrv/audiosrv.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/services/audiosrv/audiosrv.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/services/audiosrv/audiosrv.txt ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/services/audiosrv/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/mai…
============================================================================== --- trunk/reactos/base/services/audiosrv/main.c (original) +++ trunk/reactos/base/services/audiosrv/main.c Wed Sep 19 19:18:05 2007 @@ -1,131 +1,131 @@ -/* - * PROJECT: ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: base/services/audiosrv/main.c - * PURPOSE: Audio Service - * COPYRIGHT: Copyright 2007 Andrew Greenwood - */ - -#include <windows.h> - -#include <audiosrv/audiosrv.h> -#include "audiosrv.h" - - -/* Service table */ - -SERVICE_TABLE_ENTRY service_table[2] = -{ - { L"AudioSrv", (LPSERVICE_MAIN_FUNCTION) ServiceMain }, - { NULL, NULL } -}; - -SERVICE_STATUS_HANDLE service_status_handle; -SERVICE_STATUS service_status; - - -DWORD WINAPI -ServiceControlHandler( - DWORD dwControl, - DWORD dwEventType, - LPVOID lpEventData, - LPVOID lpContext) -{ - switch ( dwControl ) - { - case SERVICE_CONTROL_INTERROGATE : - { - return NO_ERROR; - } - - case SERVICE_CONTROL_STOP : - case SERVICE_CONTROL_SHUTDOWN : - { - UnregisterDeviceNotifications(); - DestroyAudioDeviceList(); - - service_status.dwCurrentState = SERVICE_STOP_PENDING; - SetServiceStatus(service_status_handle, &service_status); - - service_status.dwWin32ExitCode = 0; - service_status.dwCurrentState = SERVICE_STOPPED; - - SetServiceStatus(service_status_handle, &service_status); - - return NO_ERROR; - } - - case SERVICE_CONTROL_DEVICEEVENT : - { - return HandleDeviceEvent(dwEventType, lpEventData); - } - - default : - return ERROR_CALL_NOT_IMPLEMENTED; - }; - - /*SetServiceStatus(service_status_handle, &service_status);*/ -} - -VOID CALLBACK -ServiceMain(DWORD argc, char** argv) -{ - service_status_handle = RegisterServiceCtrlHandlerEx(SERVICE_NAME, - ServiceControlHandler, - NULL); - - /* Set these to defaults */ - service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - service_status.dwServiceSpecificExitCode = 0; - service_status.dwWin32ExitCode = NO_ERROR; - service_status.dwWaitHint = 0; - service_status.dwControlsAccepted = 0; - service_status.dwCheckPoint = 0; - - /* Tell SCM we're starting */ - service_status.dwCurrentState = SERVICE_START_PENDING; - SetServiceStatus(service_status_handle, &service_status); - - /* This creates the audio device list and mutex */ - if ( ! CreateAudioDeviceList(AUDIO_LIST_MAX_SIZE) ) - { - service_status.dwCurrentState = SERVICE_STOPPED; - service_status.dwWin32ExitCode = -1; - SetServiceStatus(service_status_handle, &service_status); - return; - } - - /* We want to know when devices are added/removed */ - if ( ! RegisterForDeviceNotifications() ) - { - DestroyAudioDeviceList(); - - service_status.dwCurrentState = SERVICE_STOPPED; - service_status.dwWin32ExitCode = -1; - SetServiceStatus(service_status_handle, &service_status); - return; - } - - /* Now find any devices that already exist on the system */ - if ( ! ProcessExistingDevices() ) - { - UnregisterDeviceNotifications(); - DestroyAudioDeviceList(); - - service_status.dwCurrentState = SERVICE_STOPPED; - service_status.dwWin32ExitCode = -1; - SetServiceStatus(service_status_handle, &service_status); - return; - } - - /* Tell SCM we are now running, and we may be stopped */ - service_status.dwCurrentState = SERVICE_RUNNING; - service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP; - SetServiceStatus(service_status_handle, &service_status); -} - -int main() -{ - StartServiceCtrlDispatcher(service_table); - return 0; -} +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/services/audiosrv/main.c + * PURPOSE: Audio Service + * COPYRIGHT: Copyright 2007 Andrew Greenwood + */ + +#include <windows.h> + +#include <audiosrv/audiosrv.h> +#include "audiosrv.h" + + +/* Service table */ + +SERVICE_TABLE_ENTRY service_table[2] = +{ + { L"AudioSrv", (LPSERVICE_MAIN_FUNCTION) ServiceMain }, + { NULL, NULL } +}; + +SERVICE_STATUS_HANDLE service_status_handle; +SERVICE_STATUS service_status; + + +DWORD WINAPI +ServiceControlHandler( + DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext) +{ + switch ( dwControl ) + { + case SERVICE_CONTROL_INTERROGATE : + { + return NO_ERROR; + } + + case SERVICE_CONTROL_STOP : + case SERVICE_CONTROL_SHUTDOWN : + { + UnregisterDeviceNotifications(); + DestroyAudioDeviceList(); + + service_status.dwCurrentState = SERVICE_STOP_PENDING; + SetServiceStatus(service_status_handle, &service_status); + + service_status.dwWin32ExitCode = 0; + service_status.dwCurrentState = SERVICE_STOPPED; + + SetServiceStatus(service_status_handle, &service_status); + + return NO_ERROR; + } + + case SERVICE_CONTROL_DEVICEEVENT : + { + return HandleDeviceEvent(dwEventType, lpEventData); + } + + default : + return ERROR_CALL_NOT_IMPLEMENTED; + }; + + /*SetServiceStatus(service_status_handle, &service_status);*/ +} + +VOID CALLBACK +ServiceMain(DWORD argc, char** argv) +{ + service_status_handle = RegisterServiceCtrlHandlerEx(SERVICE_NAME, + ServiceControlHandler, + NULL); + + /* Set these to defaults */ + service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + service_status.dwServiceSpecificExitCode = 0; + service_status.dwWin32ExitCode = NO_ERROR; + service_status.dwWaitHint = 0; + service_status.dwControlsAccepted = 0; + service_status.dwCheckPoint = 0; + + /* Tell SCM we're starting */ + service_status.dwCurrentState = SERVICE_START_PENDING; + SetServiceStatus(service_status_handle, &service_status); + + /* This creates the audio device list and mutex */ + if ( ! CreateAudioDeviceList(AUDIO_LIST_MAX_SIZE) ) + { + service_status.dwCurrentState = SERVICE_STOPPED; + service_status.dwWin32ExitCode = -1; + SetServiceStatus(service_status_handle, &service_status); + return; + } + + /* We want to know when devices are added/removed */ + if ( ! RegisterForDeviceNotifications() ) + { + DestroyAudioDeviceList(); + + service_status.dwCurrentState = SERVICE_STOPPED; + service_status.dwWin32ExitCode = -1; + SetServiceStatus(service_status_handle, &service_status); + return; + } + + /* Now find any devices that already exist on the system */ + if ( ! ProcessExistingDevices() ) + { + UnregisterDeviceNotifications(); + DestroyAudioDeviceList(); + + service_status.dwCurrentState = SERVICE_STOPPED; + service_status.dwWin32ExitCode = -1; + SetServiceStatus(service_status_handle, &service_status); + return; + } + + /* Tell SCM we are now running, and we may be stopped */ + service_status.dwCurrentState = SERVICE_RUNNING; + service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP; + SetServiceStatus(service_status_handle, &service_status); +} + +int main() +{ + StartServiceCtrlDispatcher(service_table); + return 0; +} Propchange: trunk/reactos/base/services/audiosrv/main.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/services/audiosrv/pnp.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/services/audiosrv/pnp_list_lock.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/base/services/audiosrv/pnp_list_manager.c ------------------------------------------------------------------------------ svn:eol-style = native
[View Less]
17 years, 9 months
1
0
0
0
[silverblade] 29106: Correct enumeration of Plug and Play audio devices on Windows using KSCATEGORY_AUDIO. Also detects existing audio devices in addition to dealing with device arrivals. Slight code tidy-up. Also added additional GUIDs to ks.h and ksmedia.h
by silverblade@svn.reactos.org
Author: silverblade Date: Wed Sep 19 18:42:54 2007 New Revision: 29106 URL:
http://svn.reactos.org/svn/reactos?rev=29106&view=rev
Log: Correct enumeration of Plug and Play audio devices on Windows using KSCATEGORY_AUDIO. Also detects existing audio devices in addition to dealing with device arrivals. Slight code tidy-up. Also added additional GUIDs to ks.h and ksmedia.h Added: trunk/reactos/base/services/audiosrv/audiosrv.h - copied, changed from r29100, trunk/reactos/base/
…
[View More]
services/audiosrv/pnp_list_manager.h trunk/reactos/base/services/audiosrv/pnp.c Removed: trunk/reactos/base/services/audiosrv/pnp_list_manager.h Modified: trunk/reactos/base/services/audiosrv/audiosrv.rbuild trunk/reactos/base/services/audiosrv/main.c trunk/reactos/base/services/audiosrv/pnp_list_manager.c trunk/reactos/include/psdk/ks.h trunk/reactos/include/psdk/ksmedia.h Copied: trunk/reactos/base/services/audiosrv/audiosrv.h (from r29100, trunk/reactos/base/services/audiosrv/pnp_list_manager.h) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/aud…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp_list_manager.h (original) +++ trunk/reactos/base/services/audiosrv/audiosrv.h Wed Sep 19 18:42:54 2007 @@ -1,16 +1,34 @@ /* * PROJECT: ReactOS * LICENSE: GPL - See COPYING in the top level directory - * FILE: base/services/audiosrv/pnp_list_manager.h - * PURPOSE: Audio Service List Manager + * FILE: base/services/audiosrv/audiosrv.h + * PURPOSE: Audio Service (private header) * COPYRIGHT: Copyright 2007 Andrew Greenwood */ -#include <assert.h> +#include <dbt.h> #include <audiosrv/audiosrv.h> -#ifndef PNP_LIST_MANAGER_H -#define PNP_LIST_MANAGER_H +#ifndef AUDIOSRV_PRIVATE_H +#define AUDIOSRV_PRIVATE_H + +extern SERVICE_STATUS_HANDLE service_status_handle; + + +/* main.c */ + +VOID CALLBACK +ServiceMain(DWORD argc, char** argv); + +DWORD WINAPI +ServiceControlHandler( + DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext); + + +/* List management (pnp_list_manager.c) */ VOID* CreateDeviceDescriptor(WCHAR* path, BOOL is_enabled); @@ -26,4 +44,21 @@ VOID DestroyAudioDeviceList(); + +/* Plug and Play (pnp.c) */ + +BOOL +ProcessExistingDevices(); + +DWORD +ProcessDeviceArrival(DEV_BROADCAST_DEVICEINTERFACE* device); + +BOOL +RegisterForDeviceNotifications(); + +DWORD +HandleDeviceEvent( + DWORD dwEventType, + LPVOID lpEventData); + #endif Modified: trunk/reactos/base/services/audiosrv/audiosrv.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/aud…
============================================================================== --- trunk/reactos/base/services/audiosrv/audiosrv.rbuild (original) +++ trunk/reactos/base/services/audiosrv/audiosrv.rbuild Wed Sep 19 18:42:54 2007 @@ -9,8 +9,10 @@ <library>kernel32</library> <library>advapi32</library> <library>user32</library> + <library>setupapi</library> <file>main.c</file> <file>pnp_list_manager.c</file> <file>pnp_list_lock.c</file> + <file>pnp.c</file> <file>audiosrv.rc</file> </module> Modified: trunk/reactos/base/services/audiosrv/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/mai…
============================================================================== --- trunk/reactos/base/services/audiosrv/main.c (original) +++ trunk/reactos/base/services/audiosrv/main.c Wed Sep 19 18:42:54 2007 @@ -7,28 +7,13 @@ */ #include <windows.h> -#include <winuser.h> -#include <dbt.h> + #include <audiosrv/audiosrv.h> -#include <pnp_list_manager.h> - -#include <ksmedia.h> +#include "audiosrv.h" +/* Service table */ -/* Prototypes */ - -VOID CALLBACK -ServiceMain(DWORD argc, char** argv); - -DWORD WINAPI -ServiceControlHandler( - DWORD dwControl, - DWORD dwEventType, - LPVOID lpEventData, - LPVOID lpContext); - -/* Service table */ SERVICE_TABLE_ENTRY service_table[2] = { { L"AudioSrv", (LPSERVICE_MAIN_FUNCTION) ServiceMain }, @@ -37,24 +22,7 @@ SERVICE_STATUS_HANDLE service_status_handle; SERVICE_STATUS service_status; -HDEVNOTIFY device_notification_handle = NULL; -/* Synchronization of access to the event list */ -HANDLE device_list_mutex = INVALID_HANDLE_VALUE; - - -/* Implementation */ - -DWORD -ProcessDeviceArrival(DEV_BROADCAST_DEVICEINTERFACE* device) -{ - PnP_AudioDevice* list_node; - list_node = CreateDeviceDescriptor(device->dbcc_name, TRUE); - AppendAudioDeviceToList(list_node); - DestroyDeviceDescriptor(list_node); - - return NO_ERROR; -} DWORD WINAPI ServiceControlHandler( @@ -73,12 +41,7 @@ case SERVICE_CONTROL_STOP : case SERVICE_CONTROL_SHUTDOWN : { - /* FIXME: This function doesn't exist?! */ -/* - UnregisterDeviceNotification(device_notification_handle); - device_notification_handle = NULL; -*/ - + UnregisterDeviceNotifications(); DestroyAudioDeviceList(); service_status.dwCurrentState = SERVICE_STOP_PENDING; @@ -94,23 +57,7 @@ case SERVICE_CONTROL_DEVICEEVENT : { - switch ( dwEventType ) - { - case DBT_DEVICEARRIVAL : - { - DEV_BROADCAST_DEVICEINTERFACE* incoming_device = - (DEV_BROADCAST_DEVICEINTERFACE*) lpEventData; - - return ProcessDeviceArrival(incoming_device); - } - - default : - { - break; - } - } - - return NO_ERROR; + return HandleDeviceEvent(dwEventType, lpEventData); } default : @@ -118,28 +65,6 @@ }; /*SetServiceStatus(service_status_handle, &service_status);*/ -} - -BOOL -RegisterForDeviceNotifications() -{ - DEV_BROADCAST_DEVICEINTERFACE notification_filter; - - const GUID wdmaud_guid = {STATIC_KSCATEGORY_WDMAUD}; - - /* FIXME: This currently lists ALL device interfaces... */ - ZeroMemory(¬ification_filter, sizeof(notification_filter)); - notification_filter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE); - notification_filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; - notification_filter.dbcc_classguid = wdmaud_guid; - - device_notification_handle = - RegisterDeviceNotification((HANDLE) service_status_handle, - ¬ification_filter, - DEVICE_NOTIFY_SERVICE_HANDLE | - DEVICE_NOTIFY_ALL_INTERFACE_CLASSES); - - return ( device_notification_handle != NULL ); } VOID CALLBACK @@ -181,6 +106,18 @@ return; } + /* Now find any devices that already exist on the system */ + if ( ! ProcessExistingDevices() ) + { + UnregisterDeviceNotifications(); + DestroyAudioDeviceList(); + + service_status.dwCurrentState = SERVICE_STOPPED; + service_status.dwWin32ExitCode = -1; + SetServiceStatus(service_status_handle, &service_status); + return; + } + /* Tell SCM we are now running, and we may be stopped */ service_status.dwCurrentState = SERVICE_RUNNING; service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP; Added: trunk/reactos/base/services/audiosrv/pnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/pnp…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp.c (added) +++ trunk/reactos/base/services/audiosrv/pnp.c Wed Sep 19 18:42:54 2007 @@ -1,0 +1,185 @@ +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/services/audiosrv/pnp.c + * PURPOSE: Audio Service Plug and Play + * COPYRIGHT: Copyright 2007 Andrew Greenwood + */ + +#include <windows.h> +#include <winuser.h> +#include <dbt.h> +#include <setupapi.h> + +#include <ks.h> +#include <ksmedia.h> + +#include <audiosrv/audiosrv.h> +#include "audiosrv.h" + +static HDEVNOTIFY device_notification_handle = NULL; + + +/* + Finds all devices within the KSCATEGORY_AUDIO category and puts them + in the shared device list. +*/ + +BOOL +ProcessExistingDevices() +{ + SP_DEVICE_INTERFACE_DATA interface_data; + SP_DEVINFO_DATA device_data; + PSP_DEVICE_INTERFACE_DETAIL_DATA detail_data; + HDEVINFO dev_info; + DWORD length; + int index = 0; + + const GUID category_guid = {STATIC_KSCATEGORY_AUDIO}; + + dev_info = SetupDiGetClassDevsEx(&category_guid, + NULL, + NULL, + DIGCF_PRESENT | DIGCF_DEVICEINTERFACE, + NULL, + NULL, + NULL); + +/* printf("%s:\n", ClassString); */ + + interface_data.cbSize = sizeof(interface_data); + interface_data.Reserved = 0; + + /* Enumerate the devices within the category */ + index = 0; + + length = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + + (MAX_PATH * sizeof(WCHAR)); + + detail_data = + (PSP_DEVICE_INTERFACE_DETAIL_DATA)HeapAlloc(GetProcessHeap(), + 0, + length); + + while ( + SetupDiEnumDeviceInterfaces(dev_info, + NULL, + &category_guid, + index, + &interface_data) ) + { + PnP_AudioDevice* list_node; + + ZeroMemory(detail_data, length); + + /* NOTE: We don't actually use device_data... */ + detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); + device_data.cbSize = sizeof(device_data); + device_data.Reserved = 0; + SetupDiGetDeviceInterfaceDetail(dev_info, + &interface_data, + detail_data, + length, + NULL, + &device_data); + + list_node = CreateDeviceDescriptor(detail_data->DevicePath, TRUE); + AppendAudioDeviceToList(list_node); + DestroyDeviceDescriptor(list_node); + + /* TODO: Cleanup the device we enumerated? */ + + index ++; + }; + + HeapFree(GetProcessHeap(), 0, detail_data); + + SetupDiDestroyDeviceInfoList(dev_info); + + return TRUE; +} + + +/* + Add new devices to the list as they arrive. +*/ + +DWORD +ProcessDeviceArrival(DEV_BROADCAST_DEVICEINTERFACE* device) +{ + PnP_AudioDevice* list_node; + list_node = CreateDeviceDescriptor(device->dbcc_name, TRUE); + AppendAudioDeviceToList(list_node); + DestroyDeviceDescriptor(list_node); + + return NO_ERROR; +} + + +/* + Request notification of device additions/removals. +*/ + +BOOL +RegisterForDeviceNotifications() +{ + DEV_BROADCAST_DEVICEINTERFACE notification_filter; + + const GUID wdmaud_guid = {STATIC_KSCATEGORY_AUDIO}; + + /* FIXME: This currently lists ALL device interfaces... */ + ZeroMemory(¬ification_filter, sizeof(notification_filter)); + notification_filter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE); + notification_filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; + notification_filter.dbcc_classguid = wdmaud_guid; + + device_notification_handle = + RegisterDeviceNotification((HANDLE) service_status_handle, + ¬ification_filter, + DEVICE_NOTIFY_SERVICE_HANDLE +/* | + DEVICE_NOTIFY_ALL_INTERFACE_CLASSES*/); + + return ( device_notification_handle != NULL ); +} + + +/* + When we're not interested in device notifications any more, this gets + called. +*/ + +VOID UnregisterDeviceNotifications() +{ + /* TODO -- NOT IMPLEMENTED! */ + device_notification_handle = NULL; +} + + +/* + Device events from the main service handler get passed to this. +*/ + +DWORD +HandleDeviceEvent( + DWORD dwEventType, + LPVOID lpEventData) +{ + switch ( dwEventType ) + { + case DBT_DEVICEARRIVAL : + { + DEV_BROADCAST_DEVICEINTERFACE* incoming_device = + (DEV_BROADCAST_DEVICEINTERFACE*) lpEventData; + + return ProcessDeviceArrival(incoming_device); + } + + default : + { + break; + } + } + + return NO_ERROR; +} Modified: trunk/reactos/base/services/audiosrv/pnp_list_manager.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/pnp…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp_list_manager.c (original) +++ trunk/reactos/base/services/audiosrv/pnp_list_manager.c Wed Sep 19 18:42:54 2007 @@ -46,6 +46,12 @@ static HANDLE device_list_file = NULL; static PnP_AudioHeader* audio_device_list = NULL; + + +/* + TODO: Detect duplicate entries and ignore them! (In case we receive + a PnP event for an existing device...) +*/ BOOL AppendAudioDeviceToList(PnP_AudioDevice* device) Removed: trunk/reactos/base/services/audiosrv/pnp_list_manager.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/pnp…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp_list_manager.h (original) +++ trunk/reactos/base/services/audiosrv/pnp_list_manager.h (removed) @@ -1,29 +1,0 @@ -/* - * PROJECT: ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: base/services/audiosrv/pnp_list_manager.h - * PURPOSE: Audio Service List Manager - * COPYRIGHT: Copyright 2007 Andrew Greenwood - */ - -#include <assert.h> -#include <audiosrv/audiosrv.h> - -#ifndef PNP_LIST_MANAGER_H -#define PNP_LIST_MANAGER_H - -VOID* -CreateDeviceDescriptor(WCHAR* path, BOOL is_enabled); - -#define DestroyDeviceDescriptor(descriptor) free(descriptor) - -BOOL -AppendAudioDeviceToList(PnP_AudioDevice* device); - -BOOL -CreateAudioDeviceList(DWORD max_size); - -VOID -DestroyAudioDeviceList(); - -#endif Modified: trunk/reactos/include/psdk/ks.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ks.h?rev=2910…
============================================================================== --- trunk/reactos/include/psdk/ks.h (original) +++ trunk/reactos/include/psdk/ks.h Wed Sep 19 18:42:54 2007 @@ -106,17 +106,19 @@ METHOD_NEITHER, \ FILE_ANY_ACCESS) +// WAS 2 #define IOCTL_KS_METHOD \ CTL_CODE( \ FILE_DEVICE_KS, \ - 0x002, \ + 0x003, \ METHOD_NEITHER, \ FILE_ANY_ACCESS) +// WAS 3 #define IOCTL_KS_PROPERTY \ CTL_CODE( \ FILE_DEVICE_KS, \ - 0x003, \ + 0x000, \ METHOD_NEITHER, \ FILE_ANY_ACCESS) @@ -220,6 +222,95 @@ 0x97EBAACBL, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 DEFINE_GUIDSTRUCT("97EBAACB-95BD-11D0-A3EA-00A0C9223196", KSCATEGORY_QUALITY); #define KSCATEGORY_QUALITY DEFINE_GUIDNAMED(KSCATEGORY_QUALITY) + +/* =============================================================== + Common +*/ + +typedef struct +{ + GUID Set; + ULONG Id; + ULONG Flags; +} KSIDENTIFIER, *PKSIDENTIFIER; + +typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY; +typedef KSIDENTIFIER KSMETHOD, *PKSMETHOD; +typedef KSIDENTIFIER KSEVENT, *PKSEVENT; + +typedef KSIDENTIFIER KSDEGRADE, *PKSDEGRADE; + +typedef KSIDENTIFIER KSPIN_INTERFACE, *PKSPIN_INTERFACE; +typedef KSIDENTIFIER KSPIN_MEDIUM, *PKSPIN_MEDIUM; + +typedef union +{ + struct { + ULONG FormatSize; + ULONG Flags; + ULONG SampleSize; + ULONG Reserved; + GUID MajorFormat; + GUID SubFormat; + GUID Specifier; + }; + LONGLONG Alignment; +} KSDATAFORMAT, *PKSDATAFORMAT, KSDATARANGE, *PKSDATARANGE; + +typedef struct +{ +} KSATTRIBUTE, *PKSATTRIBUTE; + + + +/* =============================================================== + Interface Sets - TODO +*/ + +#if 0 +#define KSINTERFACESETID_Media + +#define KSINTERFACESETID_Standard +#define KSINTERFACE_STANDARD_STREAMING +#define KSINTERFACE_STANDARD_LOOPED_STREAMING +#define KSINTERFACE_STANDARD_CONTROL +#endif + +typedef KSIDENTIFIER KSPIN_INTERFACE, *PKSPIN_INTERFACE; + +#define STATIC_KSINTERFACESETID_Standard \ + 0x1A8766A0L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 +DEFINE_GUIDSTRUCT("1A8766A0-62CE-11CF-A5D6-28DB04C10000", KSINTERFACESETID_Standard); +#define KSINTERFACESETID_Standard DEFINE_GUIDNAMED(KSINTERFACESETID_Standard) + +typedef enum +{ + KSINTERFACE_STANDARD_STREAMING, + KSINTERFACE_STANDARD_LOOPED_STREAMING, + KSINTERFACE_STANDARD_CONTROL +} KSINTERFACE_STANDARD; + +#define STATIC_KSINTERFACESETID_FileIo \ + 0x8C6F932CL, 0xE771, 0x11D0, 0xB8, 0xFF, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +DEFINE_GUIDSTRUCT("8C6F932C-E771-11D0-B8FF-00A0C9223196", KSINTERFACESETID_FileIo); +#define KSINTERFACESETID_FileIo DEFINE_GUIDNAMED(KSINTERFACESETID_FileIo) + + +/* =============================================================== + Mediums +*/ + +typedef enum +{ + KSINTERFACE_FILEIO_STREAMING +} KSINTERFACE_FILEIO; + +#define KSMEDIUM_TYPE_ANYINSTANCE 0 + +#define STATIC_KSMEDIUMSETID_Standard \ + 0x4747B320L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 +DEFINE_GUIDSTRUCT("4747B320-62CE-11CF-A5D6-28DB04C10000", KSMEDIUMSETID_Standard); +#define KSMEDIUMSETID_Standard DEFINE_GUIDNAMED(KSMEDIUMSETID_Standard) /* =============================================================== @@ -341,8 +432,10 @@ Properties/Methods/Events */ -#define KSPROPSETID_Pin \ +#define STATIC_KSPROPSETID_Pin\ 0x8C134960L, 0x51AD, 0x11CF, 0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00 +DEFINE_GUIDSTRUCT("8C134960-51AD-11CF-878A-94F801C10000", KSPROPSETID_Pin); +#define KSPROPSETID_Pin DEFINE_GUIDNAMED(KSPROPSETID_Pin) typedef enum { @@ -362,6 +455,28 @@ KSPROPERTY_PIN_CONSTRAINEDDATARANGES, KSPROPERTY_PIN_PROPOSEDATAFORMAT } KSPROPERTY_PIN; + +typedef struct +{ + KSPROPERTY Property; + ULONG PinId; + ULONG Reserved; +} KSP_PIN, *PKSP_PIN; + +#define KSINSTANCE_INDETERMINATE ((ULONG)-1) + +typedef struct +{ + ULONG PossibleCount; + ULONG CurrentCount; +} KSPIN_CINSTANCES, *PKSPIN_CINSTANCES; + +typedef struct +{ + ULONG Size; + ULONG Pin; + WCHAR SymbolicLinkName[1]; +} KSPIN_PHYSICALCONNECTION, *PKSPIN_PHYSICALCONNECTION; /* =============================================================== @@ -605,7 +720,7 @@ KSPROPERTY_SYNTH_DLS_WAVEFORMAT */ -#define KSPROPSETID_Sysaudio +/* #define KSPROPSETID_Sysaudio */ /* KSPROPERTY_SYSAUDIO_COMPONENT_ID KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE @@ -629,16 +744,6 @@ */ -/* =============================================================== - Interface Sets - TODO -*/ - -#define KSINTERFACESETID_Media - -#define KSINTERFACESETID_Standard -#define KSINTERFACE_STANDARD_STREAMING -#define KSINTERFACE_STANDARD_LOOPED_STREAMING -#define KSINTERFACE_STANDARD_CONTROL /* =============================================================== @@ -980,39 +1085,6 @@ /* =============================================================== - Common -*/ - -typedef struct -{ - GUID Set; - ULONG Id; - ULONG Flags; -} KSIDENTIFIER, *PKSIDENTIFIER; - -typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY; -typedef KSIDENTIFIER KSMETHOD, *PKSMETHOD; -typedef KSIDENTIFIER KSEVENT, *PKSEVENT; - -typedef KSIDENTIFIER KSDEGRADE, *PKSDEGRADE; - -typedef KSIDENTIFIER KSPIN_INTERFACE, *PKSPIN_INTERFACE; -typedef KSIDENTIFIER KSPIN_MEDIUM, *PKSPIN_MEDIUM; - -typedef struct -{ -} KSDATARANGE, *PKSDATARANGE; - -typedef struct -{ -} KSDATAFORMAT, *PKSDATAFORMAT; - -typedef struct -{ -} KSATTRIBUTE, *PKSATTRIBUTE; - - -/* =============================================================== Priorities */ @@ -1053,6 +1125,12 @@ typedef struct { + GUID Manufacturer; + GUID Product; + GUID Component; + GUID Name; + ULONG Version; + ULONG Revision; } KSCOMPONENTID, *PKSCOMPONENTID; typedef struct @@ -1235,8 +1313,9 @@ typedef VOID (*PFNKSITEMFREECALLBACK)( IN PKSOBJECT_CREATE_ITEM CreateItem); -typedef struct -{ +typedef struct { + ULONG Size; + ULONG Count; } KSMULTIPLE_ITEM, *PKSMULTIPLE_ITEM; typedef struct @@ -1416,14 +1495,6 @@ KSPRIORITY Priority; } KSPIN_CONNECT, *PKSPIN_CONNECT; -typedef struct -{ -} KSP_PIN, *PKSP_PIN; - -typedef struct -{ -} KSPIN_PHYSICALCONNECTION, *PKSPIN_PHYSICALCONNECTION; - /* =============================================================== Topology Modified: trunk/reactos/include/psdk/ksmedia.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ksmedia.h?rev…
============================================================================== --- trunk/reactos/include/psdk/ksmedia.h (original) +++ trunk/reactos/include/psdk/ksmedia.h Wed Sep 19 18:42:54 2007 @@ -10,9 +10,186 @@ #include <ks.h> +/* + KS CATEGORIES +*/ + + +/* Audio device (as presented by sysaudio) */ + +#define STATIC_KSCATEGORY_AUDIO_DEVICE \ + 0xFBF6F530L, 0x07B9, 0x11D2, 0xA7, 0x1E, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 +DEFINE_GUIDSTRUCT("FBF6F530-07B9-11D2-A71E-0000F8004788", KSCATEGORY_AUDIO_DEVICE); +#define KSCATEGORY_AUDIO_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_DEVICE) + +/* Preferred devices */ + +#define STATIC_KSCATEGORY_PREFERRED_WAVEOUT_DEVICE \ + 0xD6C5066EL, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 +DEFINE_GUIDSTRUCT("D6C5066E-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEOUT_DEVICE); +#define KSCATEGORY_PREFERRED_WAVEOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEOUT_DEVICE) + +#define STATIC_KSCATEGORY_PREFERRED_WAVEIN_DEVICE \ + 0xD6C50671L, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 +DEFINE_GUIDSTRUCT("D6C50671-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEIN_DEVICE); +#define KSCATEGORY_PREFERRED_WAVEIN_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEIN_DEVICE) + +#define STATIC_KSCATEGORY_PREFERRED_MIDIOUT_DEVICE \ + 0xD6C50674L, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 +DEFINE_GUIDSTRUCT("D6C50674-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_MIDIOUT_DEVICE); +#define KSCATEGORY_PREFERRED_MIDIOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_MIDIOUT_DEVICE) + + +/* Media type categories */ + +#define STATIC_KSCATEGORY_AUDIO \ + 0x6994AD04L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +DEFINE_GUIDSTRUCT("6994AD04-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_AUDIO); +#define KSCATEGORY_AUDIO DEFINE_GUIDNAMED(KSCATEGORY_AUDIO) + +#define STATIC_KSCATEGORY_VIDEO \ + 0x6994AD05L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +DEFINE_GUIDSTRUCT("6994AD05-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_VIDEO); +#define KSCATEGORY_VIDEO DEFINE_GUIDNAMED(KSCATEGORY_VIDEO) + +#define STATIC_KSCATEGORY_TEXT \ + 0x6994AD06L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +DEFINE_GUIDSTRUCT("6994AD06-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_TEXT); +#define KSCATEGORY_TEXT DEFINE_GUIDNAMED(KSCATEGORY_TEXT) + +#define STATIC_KSCATEGORY_NETWORK \ + 0x67C9CC3CL, 0x69C4, 0x11D2, 0x87, 0x59, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +DEFINE_GUIDSTRUCT("67C9CC3C-69C4-11D2-8759-00A0C9223196", KSCATEGORY_NETWORK); +#define KSCATEGORY_NETWORK DEFINE_GUIDNAMED(KSCATEGORY_NETWORK) + +#define STATIC_KSINTERFACESETID_Media \ + 0x3A13EB40L, 0x30A7, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 +DEFINE_GUIDSTRUCT("3A13EB40-30A7-11D0-A5D6-28DB04C10000", KSINTERFACESETID_Media); +#define KSINTERFACESETID_Media DEFINE_GUIDNAMED(KSINTERFACESETID_Media) + +/* ... */ + +#define STATIC_KSCATEGORY_TOPOLOGY \ + 0xDDA54A40L, 0x1E4C, 0x11D1, 0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00 +DEFINE_GUIDSTRUCT("DDA54A40-1E4C-11D1-A050-405705C10000", KSCATEGORY_TOPOLOGY); +#define KSCATEGORY_TOPOLOGY DEFINE_GUIDNAMED(KSCATEGORY_TOPOLOGY) + +#define STATIC_KSCATEGORY_VIRTUAL \ + 0x3503EAC4L, 0x1F26, 0x11D1, 0x8A, 0xB0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +DEFINE_GUIDSTRUCT("3503EAC4-1F26-11D1-8AB0-00A0C9223196", KSCATEGORY_VIRTUAL); +#define KSCATEGORY_VIRTUAL DEFINE_GUIDNAMED(KSCATEGORY_VIRTUAL) + +#define STATIC_KSCATEGORY_ACOUSTIC_ECHO_CANCEL \ + 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1 +DEFINE_GUIDSTRUCT("BF963D80-C559-11D0-8A2B-00A0C9255AC1", KSCATEGORY_ACOUSTIC_ECHO_CANCEL); +#define KSCATEGORY_ACOUSTIC_ECHO_CANCEL DEFINE_GUIDNAMED(KSCATEGORY_ACOUSTIC_ECHO_CANCEL) + + +/* Component-specific */ + +#define STATIC_KSCATEGORY_SYSAUDIO \ + 0xA7C7A5B1L, 0x5AF3, 0x11D1, 0x9C, 0xED, 0x00, 0xA0, 0x24, 0xBF, 0x04, 0x07 +DEFINE_GUIDSTRUCT("A7C7A5B1-5AF3-11D1-9CED-00A024BF0407", KSCATEGORY_SYSAUDIO); +#define KSCATEGORY_SYSAUDIO DEFINE_GUIDNAMED(KSCATEGORY_SYSAUDIO) + #define STATIC_KSCATEGORY_WDMAUD \ - 0x3e227e76L, 0x690d, 0x11d2, 0x81, 0x61, 0x00, 0x00, 0xf8, 0x77, 0x5b, 0xf1 + 0x3E227E76L, 0x690D, 0x11D2, 0x81, 0x61, 0x00, 0x00, 0xF8, 0x77, 0x5B, 0xF1 DEFINE_GUIDSTRUCT("3E227E76-690D-11D2-8161-0000F8775BF1", KSCATEGORY_WDMAUD); #define KSCATEGORY_WDMAUD DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD) +#define STATIC_KSCATEGORY_AUDIO_GFX \ + 0x9BAF9572L, 0x340C, 0x11D3, 0xAB, 0xDC, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0x6F +DEFINE_GUIDSTRUCT("9BAF9572-340C-11D3-ABDC-00A0C90AB16F", KSCATEGORY_AUDIO_GFX); +#define KSCATEGORY_AUDIO_GFX DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_GFX) + +#define STATIC_KSCATEGORY_AUDIO_SPLITTER \ + 0x9EA331FAL, 0xB91B, 0x45F8, 0x92, 0x85, 0xBD, 0x2B, 0xC7, 0x7A, 0xFC, 0xDE +DEFINE_GUIDSTRUCT("9EA331FA-B91B-45F8-9285-BD2BC77AFCDE", KSCATEGORY_AUDIO_SPLITTER); +#define KSCATEGORY_AUDIO_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_SPLITTER) + +#define STATIC_KSCATEGORY_SYNTHESIZER STATIC_KSNODETYPE_SYNTHESIZER +#define KSCATEGORY_SYNTHESIZER KSNODETYPE_SYNTHESIZER + +#define STATIC_KSCATEGORY_DRM_DESCRAMBLE STATIC_KSNODETYPE_DRM_DESCRAMBLE +#define KSCATEGORY_DRM_DESCRAMBLE KSNODETYPE_DRM_DESCRAMBLE + +/* + Pins +*/ + +#define STATIC_KSCATEGORY_WDMAUD_USE_PIN_NAME \ + 0x47A4FA20L, 0xA251, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88 +DEFINE_GUIDSTRUCT("47A4FA20-A251-11D1-A050-0000F8004788", KSCATEGORY_WDMAUD_USE_PIN_NAME); +#define KSCATEGORY_WDMAUD_USE_PIN_NAME DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD_USE_PIN_NAME) + + +/* + Formats +*/ + +// 'vids' +#define STATIC_KSDATAFORMAT_TYPE_VIDEO \ + 0x73646976L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 +DEFINE_GUIDSTRUCT("73646976-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_VIDEO); +#define KSDATAFORMAT_TYPE_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_VIDEO) + +// 'auds' +#define STATIC_KSDATAFORMAT_TYPE_AUDIO \ + 0x73647561L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 +DEFINE_GUIDSTRUCT("73647561-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_AUDIO); +#define KSDATAFORMAT_TYPE_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_AUDIO) + +// 'txts' +#define STATIC_KSDATAFORMAT_TYPE_TEXT \ + 0x73747874L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 +DEFINE_GUIDSTRUCT("73747874-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_TEXT); +#define KSDATAFORMAT_TYPE_TEXT DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_TEXT) + +#define STATIC_KSDATAFORMAT_TYPE_MUSIC \ + 0xE725D360L, 0x62CC, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 +DEFINE_GUIDSTRUCT("E725D360-62CC-11CF-A5D6-28DB04C10000", KSDATAFORMAT_TYPE_MUSIC); +#define KSDATAFORMAT_TYPE_MUSIC DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MUSIC) + +// 'mids' +#define STATIC_KSDATAFORMAT_TYPE_MIDI \ + 0x7364696DL, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 +DEFINE_GUIDSTRUCT("7364696D-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_MIDI); +#define KSDATAFORMAT_TYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MIDI) + +#define STATIC_KSDATAFORMAT_SUBTYPE_MIDI \ + 0x1D262760L, 0xE957, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 +DEFINE_GUIDSTRUCT("1D262760-E957-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI); +#define KSDATAFORMAT_SUBTYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI) + + +/* + SysAudio Properties +*/ + +#define STATIC_KSPROPSETID_Sysaudio \ + 0xCBE3FAA0L, 0xCC75, 0x11D0, 0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6 +DEFINE_GUIDSTRUCT("CBE3FAA0-CC75-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio); +#define KSPROPSETID_Sysaudio DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio) + +typedef enum { + KSPROPERTY_SYSAUDIO_DEVICE_COUNT = 1, + KSPROPERTY_SYSAUDIO_DEVICE_FRIENDLY_NAME = 2, + KSPROPERTY_SYSAUDIO_DEVICE_INSTANCE = 3, + KSPROPERTY_SYSAUDIO_DEVICE_INTERFACE_NAME = 4, + KSPROPERTY_SYSAUDIO_SELECT_GRAPH = 5, + KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE = 6, + KSPROPERTY_SYSAUDIO_DEVICE_DEFAULT = 7, + KSPROPERTY_SYSAUDIO_INSTANCE_INFO = 14, + KSPROPERTY_SYSAUDIO_COMPONENT_ID = 16 +} KSPROPERTY_SYSAUDIO; + +typedef struct { + KSPROPERTY Property; + ULONG Flags; + ULONG DeviceNumber; +} SYSAUDIO_INSTANCE_INFO, *PSYSAUDIO_INSTANCE_INFO; + +#define SYSAUDIO_FLAGS_DONT_COMBINE_PINS 0x00000001 + + #endif
[View Less]
17 years, 9 months
1
0
0
0
[jimtabor] 29105: Win32k: - Add thread information pointer to the user handle entry. This will be useful for checking handles, if the handle is not part of the current thread. - Add a test to make sure the current process passes the gHandleTable pointer to user32. - These changes are important for allowing User32 to read-only the handle object information. Not 100% compatible, we need NtUserProcessConnect and CsrClientConnectToServer. Need a full understanding how they both work with User32. Ref
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Sep 19 17:24:58 2007 New Revision: 29105 URL:
http://svn.reactos.org/svn/reactos?rev=29105&view=rev
Log: Win32k: - Add thread information pointer to the user handle entry. This will be useful for checking handles, if the handle is not part of the current thread. - Add a test to make sure the current process passes the gHandleTable pointer to user32. - These changes are important for allowing User32 to read-only the handle object information. Not 100% compatible,
…
[View More]
we need NtUserProcessConnect and CsrClientConnectToServer. Need a full understanding how they both work with User32. Ref: -
https://www.microsoft.com/msj/0397/hood/hood0397.aspx
-
http://www.winterdom.com/dev/ui/wnd.html
Modified: trunk/reactos/subsystems/win32/win32k/include/object.h trunk/reactos/subsystems/win32/win32k/ntuser/object.c Modified: trunk/reactos/subsystems/win32/win32k/include/object.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/object.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/object.h Wed Sep 19 17:24:58 2007 @@ -20,6 +20,7 @@ typedef struct _USER_HANDLE_ENTRY { void *ptr; /* pointer to object */ + PW32THREADINFO pti; // pointer to Win32ThreadInfo unsigned short type; /* object type (0 if free) */ unsigned short generation; /* generation counter */ } USER_HANDLE_ENTRY, * PUSER_HANDLE_ENTRY; @@ -41,11 +42,11 @@ otFree = 0, otWindow, otMenu, + otCursorIcon, + otHook = 5, + otCallProc = 7, otAccel, - otCursorIcon, - otHook, - otMonitor, - otCallProc + otMonitor = 12 } USER_OBJECT_TYPE; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/object.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/object.c Wed Sep 19 17:24:58 2007 @@ -108,6 +108,7 @@ ret = entry->ptr; entry->ptr = ht->freelist; entry->type = 0; + entry->pti = 0; ht->freelist = entry; usedHandles--; @@ -123,6 +124,8 @@ return 0; entry->ptr = object; entry->type = type; + entry->pti = GetW32ThreadInfo(); + if (entry->pti->pi->UserHandleTable == NULL) GetW32ProcessInfo(); if (++entry->generation >= 0xffff) entry->generation = 1; return entry_to_handle(ht, entry );
[View Less]
17 years, 9 months
1
0
0
0
[hpoussin] 29104: Fix weird bug in Project::ResolveProperties(), which was modifying the string given in argument
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Sep 19 16:06:39 2007 New Revision: 29104 URL:
http://svn.reactos.org/svn/reactos?rev=29104&view=rev
Log: Fix weird bug in Project::ResolveProperties(), which was modifying the string given in argument Modified: trunk/reactos/tools/rbuild/project.cpp trunk/reactos/tools/rbuild/rbuild.h Modified: trunk/reactos/tools/rbuild/project.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/project.cpp?r…
========================================
…
[View More]
====================================== --- trunk/reactos/tools/rbuild/project.cpp (original) +++ trunk/reactos/tools/rbuild/project.cpp Wed Sep 19 16:06:39 2007 @@ -196,7 +196,7 @@ } string -Project::ResolveNextProperty ( string& s ) const +Project::ResolveNextProperty ( const string& s ) const { size_t i = s.find ( "${" ); if ( i == string::npos ) @@ -215,7 +215,7 @@ string propertyName = s.substr ( i + 2, propertyNameLength ); const Property* property = LookupProperty ( propertyName ); if ( property != NULL ) - return s.replace ( i, propertyNameLength + 3, property->value ); + return string ( s ).replace ( i, propertyNameLength + 3, property->value ); } } return s; Modified: trunk/reactos/tools/rbuild/rbuild.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.h (original) +++ trunk/reactos/tools/rbuild/rbuild.h Wed Sep 19 16:06:39 2007 @@ -251,7 +251,7 @@ const std::string& GetProjectFilename () const; std::string ResolveProperties ( const std::string& s ) const; private: - std::string ResolveNextProperty ( std::string& s ) const; + std::string ResolveNextProperty ( const std::string& s ) const; const Property* LookupProperty ( const std::string& name ) const; void SetConfigurationOption ( char* s, std::string name,
[View Less]
17 years, 9 months
1
0
0
0
[hpoussin] 29103: Remove rbuild stdlib="host" attribute. That was a workaround to build system deficiency. Now, base the workaround on presence of C++ files in module
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Sep 19 15:11:57 2007 New Revision: 29103 URL:
http://svn.reactos.org/svn/reactos?rev=29103&view=rev
Log: Remove rbuild stdlib="host" attribute. That was a workaround to build system deficiency. Now, base the workaround on presence of C++ files in module Modified: trunk/reactos/base/applications/games/solitaire/solitaire.rbuild trunk/reactos/base/applications/network/telnet/telnet.rbuild trunk/reactos/base/shell/explorer/explorer.rbuild trunk/
…
[View More]
reactos/dll/win32/glu32/glu32.rbuild trunk/reactos/dll/win32/usp10/usp10.rbuild trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h trunk/reactos/tools/rbuild/module.cpp trunk/reactos/tools/rbuild/project.dtd trunk/reactos/tools/rbuild/rbuild.h Modified: trunk/reactos/base/applications/games/solitaire/solitaire.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/so…
============================================================================== --- trunk/reactos/base/applications/games/solitaire/solitaire.rbuild (original) +++ trunk/reactos/base/applications/games/solitaire/solitaire.rbuild Wed Sep 19 15:11:57 2007 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> -<module name="sol" type="win32gui" installbase="system32" installname="sol.exe" unicode="no" allowwarnings="true" stdlib="host"> +<module name="sol" type="win32gui" installbase="system32" installname="sol.exe" unicode="no" allowwarnings="true"> <include base="sol">.</include> <include base="sol">cardlib</include> <linkerflag>-lstdc++</linkerflag> Modified: trunk/reactos/base/applications/network/telnet/telnet.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/telnet/telnet.rbuild (original) +++ trunk/reactos/base/applications/network/telnet/telnet.rbuild Wed Sep 19 15:11:57 2007 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> -<module name="telnet" type="win32cui" installbase="system32" installname="telnet.exe" allowwarnings ="true" stdlib="host"> +<module name="telnet" type="win32cui" installbase="system32" installname="telnet.exe" allowwarnings ="true"> <include base="telnet">.</include> <define name="__USE_W32API" /> <define name="__REACTOS__" /> Modified: trunk/reactos/base/shell/explorer/explorer.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
============================================================================== --- trunk/reactos/base/shell/explorer/explorer.rbuild (original) +++ trunk/reactos/base/shell/explorer/explorer.rbuild Wed Sep 19 15:11:57 2007 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> -<module name="explorer" type="win32gui" installname="explorer.exe" allowwarnings="true" stdlib="host" usewrc="false"> +<module name="explorer" type="win32gui" installname="explorer.exe" allowwarnings="true" usewrc="false"> <linkerflag>-fexceptions</linkerflag> <include base="explorer">.</include> <define name="__USE_W32API" /> Modified: trunk/reactos/dll/win32/glu32/glu32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/glu32/glu32.rbui…
============================================================================== --- trunk/reactos/dll/win32/glu32/glu32.rbuild (original) +++ trunk/reactos/dll/win32/glu32/glu32.rbuild Wed Sep 19 15:11:57 2007 @@ -1,4 +1,4 @@ -<module name="glu32" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_GLU32}" installbase="system32" installname="glu32.dll" allowwarnings="true" stdlib="host"> +<module name="glu32" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_GLU32}" installbase="system32" installname="glu32.dll" allowwarnings="true"> <importlibrary definition="glu32.def" /> <include base="glu32">include</include> <include base="glu32">libnurbs/internals</include> @@ -17,7 +17,7 @@ <library>msvcrt</library> <directory name="libnurbs"> <directory name="interface"> - <file>bezierEval.cc</file> + <file>bezierEval.cc</file> <file>bezierPatch.cc</file> <file>bezierPatchMesh.cc</file> <file>glcurveval.cc</file> Modified: trunk/reactos/dll/win32/usp10/usp10.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/usp10.rbui…
============================================================================== --- trunk/reactos/dll/win32/usp10/usp10.rbuild (original) +++ trunk/reactos/dll/win32/usp10/usp10.rbuild Wed Sep 19 15:11:57 2007 @@ -1,4 +1,4 @@ -<module name="usp10" type="win32dll" entrypoint="0" installbase="system32" installname="usp10.dll" allowwarnings ="true" stdlib="host"> +<module name="usp10" type="win32dll" entrypoint="0" installbase="system32" installname="usp10.dll" allowwarnings ="true"> <importlibrary definition="usp10.spec.def" /> <include base="usp10">.</include> <include base="ReactOS">include/reactos/wine</include> Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
============================================================================== --- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original) +++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Wed Sep 19 15:11:57 2007 @@ -625,7 +625,7 @@ } else { - fprintf ( OUT, "\t\t\t\t\t<Add option=\"%s\" />\r\n", module.useHostStdlib ? "-nostartfiles" : "-nostartfiles -Wl,--nostdlib" ); + fprintf ( OUT, "\t\t\t\t\t<Add option=\"%s\" />\r\n", module.cplusplus ? "-nostartfiles" : "-nostartfiles -Wl,--nostdlib" ); fprintf ( OUT, "\t\t\t\t\t<Add library=\"gcc\" />\r\n" ); } } @@ -641,7 +641,7 @@ else if ( module.type == NativeDLL) fprintf ( OUT, "\t\t\t\t\t<Add option=\"-nostartfiles -Wl,--shared\" />\r\n" ); - fprintf ( OUT, "\t\t\t\t\t<Add option=\"%s\" />\r\n", module.useHostStdlib ? "-nostartfiles" : "-nostartfiles -Wl,--nostdlib" ); + fprintf ( OUT, "\t\t\t\t\t<Add option=\"%s\" />\r\n", module.cplusplus ? "-nostartfiles" : "-nostartfiles -Wl,--nostdlib" ); fprintf ( OUT, "\t\t\t\t\t<Add library=\"gcc\" />\r\n" ); } Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h Wed Sep 19 15:11:57 2007 @@ -330,7 +330,7 @@ MingwWin32DLLModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } + std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } void AddImplicitLibraries ( Module& module ); private: void GenerateWin32DLLModuleTarget (); @@ -343,7 +343,7 @@ MingwWin32OCXModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } + std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } void AddImplicitLibraries ( Module& module ); private: void GenerateWin32OCXModuleTarget (); @@ -356,7 +356,7 @@ MingwWin32CUIModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } + std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } void AddImplicitLibraries ( Module& module ); private: void GenerateWin32CUIModuleTarget (); @@ -369,7 +369,7 @@ MingwWin32GUIModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } + std::string TypeSpecificLinkerFlags() { return module.cplusplus ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } void AddImplicitLibraries ( Module& module ); private: void GenerateWin32GUIModuleTarget (); Modified: trunk/reactos/tools/rbuild/module.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/module.cpp?re…
============================================================================== --- trunk/reactos/tools/rbuild/module.cpp (original) +++ trunk/reactos/tools/rbuild/module.cpp Wed Sep 19 15:11:57 2007 @@ -297,25 +297,6 @@ } else isUnicode = false; - - att = moduleNode.GetAttribute ( "stdlib", false ); - if ( att != NULL ) - { - const char* p = att->value.c_str(); - if ( !stricmp ( p, "host" ) ) - useHostStdlib = true; - else if ( !stricmp ( p, "default" ) ) - useHostStdlib = false; - else - { - throw InvalidAttributeValueException ( - moduleNode.location, - "stdlib", - att->value ); - } - } - else - useHostStdlib = false; if (isUnicode) { Modified: trunk/reactos/tools/rbuild/project.dtd URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/project.dtd?r…
============================================================================== --- trunk/reactos/tools/rbuild/project.dtd (original) +++ trunk/reactos/tools/rbuild/project.dtd Wed Sep 19 15:11:57 2007 @@ -127,7 +127,6 @@ allowwarnings (true|false) "false" aliasof %Text; #IMPLIED unicode (true|yes|false|no) "no" - stdlib (host) #IMPLIED isstartuplib (true) #IMPLIED buildtype %Text; #FIXED "OFWLDR" > Modified: trunk/reactos/tools/rbuild/rbuild.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.h (original) +++ trunk/reactos/tools/rbuild/rbuild.h Wed Sep 19 15:11:57 2007 @@ -357,7 +357,6 @@ bool useWRC; bool allowWarnings; bool enabled; - bool useHostStdlib; bool isStartupLib; FileLocation *output; // "path/foo.exe" FileLocation *dependency; // "path/foo.exe" or "path/libfoo.a"
[View Less]
17 years, 9 months
1
0
0
0
[hpoussin] 29102: Fix an old rbuild bug: .gch file now depends of intermediate module directory, and can create it if needed
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Sep 19 13:34:05 2007 New Revision: 29102 URL:
http://svn.reactos.org/svn/reactos?rev=29102&view=rev
Log: Fix an old rbuild bug: .gch file now depends of intermediate module directory, and can create it if needed Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
=============================
…
[View More]
================================================= --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Wed Sep 19 13:34:05 2007 @@ -1738,9 +1738,10 @@ GetRpcHeaderDependencies ( rpcDependencies ); dependencies += " " + v2s ( backend, rpcDependencies, 5 ); fprintf ( fMakefile, - "%s: %s\n", + "%s: %s | %s\n", backend->GetFullName ( *pchFilename ).c_str(), - dependencies.c_str() ); + dependencies.c_str(), + backend->GetFullPath ( *pchFilename ).c_str() ); fprintf ( fMakefile, "\t$(ECHO_PCH)\n" ); fprintf ( fMakefile, "\t%s -o %s %s -g %s\n\n",
[View Less]
17 years, 9 months
1
0
0
0
[frik85] 29101: RosCMS update: * fixed bug, related to group checking (thanks to CCTAHEB for reporting the issue)
by frik85@svn.reactos.org
Author: frik85 Date: Wed Sep 19 11:53:53 2007 New Revision: 29101 URL:
http://svn.reactos.org/svn/reactos?rev=29101&view=rev
Log: RosCMS update: * fixed bug, related to group checking (thanks to CCTAHEB for reporting the issue) Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
================================================
…
[View More]
============================== ---
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
(original) +++
trunk/web/reactos.org/htdocs/roscms/inc/data_edit.php
Wed Sep 19 11:53:53 2007 @@ -1270,7 +1270,7 @@ if ($result_account_lang['user_language'] == "") { die("Set a valid language in your myReactOS account settings!"); } - else if ($result_account_lang['user_language'] != $result_rev_data['data_id']) { + else if ($result_account_lang['user_language'] != $result_rev_data['rev_language']) { echo "As Language Maintainer you can only mark entries of '".$result_account_lang['user_language']."' language as new!"; continue; }
[View Less]
17 years, 9 months
1
0
0
0
[silverblade] 29100: ReactOS Audio Service. Has not been tested within ReactOS but on Windows (XP) it now detects when new devices have been attached. This information is shared via a mapped file. I have also written a utility to read the contents of the mapped file (this is not included - further work is required). Added a few missing #defines to dbt.h and also reformatted some of the WinMM code so it was clearer to read.
by silverblade@svn.reactos.org
Author: silverblade Date: Wed Sep 19 08:13:24 2007 New Revision: 29100 URL:
http://svn.reactos.org/svn/reactos?rev=29100&view=rev
Log: ReactOS Audio Service. Has not been tested within ReactOS but on Windows (XP) it now detects when new devices have been attached. This information is shared via a mapped file. I have also written a utility to read the contents of the mapped file (this is not included - further work is required). Added a few missing #defines to dbt.h and also
…
[View More]
reformatted some of the WinMM code so it was clearer to read. Added: trunk/reactos/base/services/audiosrv/pnp_list_lock.c trunk/reactos/base/services/audiosrv/pnp_list_manager.c trunk/reactos/base/services/audiosrv/pnp_list_manager.h trunk/reactos/include/reactos/libs/audiosrv/ trunk/reactos/include/reactos/libs/audiosrv/audiosrv.h Modified: trunk/reactos/base/services/audiosrv/audiosrv.rbuild trunk/reactos/base/services/audiosrv/main.c trunk/reactos/dll/win32/winmm/driver.c trunk/reactos/dll/win32/winmm/lolvldrv.c trunk/reactos/include/psdk/dbt.h Modified: trunk/reactos/base/services/audiosrv/audiosrv.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/aud…
============================================================================== --- trunk/reactos/base/services/audiosrv/audiosrv.rbuild (original) +++ trunk/reactos/base/services/audiosrv/audiosrv.rbuild Wed Sep 19 08:13:24 2007 @@ -1,10 +1,16 @@ -<module name="audiosrv" type="win32cui" installbase="system32" installname="audiosrv.exe" allowwarnings="true"> +<module name="audiosrv" type="win32cui" installbase="system32" +installname="audiosrv.exe" allowwarnings="true"> <include base="audiosrv">.</include> + <define name="UNICODE" /> <define name="__USE_W32API" /> <define name="__REACTOS__" /> <define name="_WIN32_WINNT">0x0501</define> + <define name="WINVER">0x0501</define> <library>kernel32</library> <library>advapi32</library> + <library>user32</library> <file>main.c</file> + <file>pnp_list_manager.c</file> + <file>pnp_list_lock.c</file> <file>audiosrv.rc</file> </module> Modified: trunk/reactos/base/services/audiosrv/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/mai…
============================================================================== --- trunk/reactos/base/services/audiosrv/main.c (original) +++ trunk/reactos/base/services/audiosrv/main.c Wed Sep 19 08:13:24 2007 @@ -7,16 +7,12 @@ */ #include <windows.h> +#include <winuser.h> +#include <dbt.h> +#include <audiosrv/audiosrv.h> +#include <pnp_list_manager.h> -/* This is currently set to avoid conflicting service names in Windows! */ -#define SERVICE_NAME "RosAudioSrv" - -/* A named mutex is used for synchronizing access to the device list. - If this mutex doesn't exist, it means the audio service isn't running. */ -#define DEVICE_LIST_MUTEX_NAME "Global\\AudioDeviceListSync" - -/* ...and this is where the device list will be available */ -#define DEVICE_LIST_MAPPED_FILENAME "Global\\AudioDeviceList" +#include <ksmedia.h> @@ -25,19 +21,23 @@ VOID CALLBACK ServiceMain(DWORD argc, char** argv); -VOID WINAPI -ServiceControlHandler(DWORD request); - +DWORD WINAPI +ServiceControlHandler( + DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext); /* Service table */ SERVICE_TABLE_ENTRY service_table[2] = { - { "AudioSrv", (LPSERVICE_MAIN_FUNCTION) ServiceMain }, + { L"AudioSrv", (LPSERVICE_MAIN_FUNCTION) ServiceMain }, { NULL, NULL } }; SERVICE_STATUS_HANDLE service_status_handle; SERVICE_STATUS service_status; +HDEVNOTIFY device_notification_handle = NULL; /* Synchronization of access to the event list */ HANDLE device_list_mutex = INVALID_HANDLE_VALUE; @@ -45,40 +45,109 @@ /* Implementation */ -VOID WINAPI -ServiceControlHandler(DWORD request) +DWORD +ProcessDeviceArrival(DEV_BROADCAST_DEVICEINTERFACE* device) { - switch ( request ) + PnP_AudioDevice* list_node; + list_node = CreateDeviceDescriptor(device->dbcc_name, TRUE); + AppendAudioDeviceToList(list_node); + DestroyDeviceDescriptor(list_node); + + return NO_ERROR; +} + +DWORD WINAPI +ServiceControlHandler( + DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext) +{ + switch ( dwControl ) { + case SERVICE_CONTROL_INTERROGATE : + { + return NO_ERROR; + } + case SERVICE_CONTROL_STOP : case SERVICE_CONTROL_SHUTDOWN : { + /* FIXME: This function doesn't exist?! */ +/* + UnregisterDeviceNotification(device_notification_handle); + device_notification_handle = NULL; +*/ + + DestroyAudioDeviceList(); + service_status.dwCurrentState = SERVICE_STOP_PENDING; SetServiceStatus(service_status_handle, &service_status); - - CloseHandle(device_list_mutex); service_status.dwWin32ExitCode = 0; service_status.dwCurrentState = SERVICE_STOPPED; SetServiceStatus(service_status_handle, &service_status); - return; + return NO_ERROR; } + case SERVICE_CONTROL_DEVICEEVENT : + { + switch ( dwEventType ) + { + case DBT_DEVICEARRIVAL : + { + DEV_BROADCAST_DEVICEINTERFACE* incoming_device = + (DEV_BROADCAST_DEVICEINTERFACE*) lpEventData; + + return ProcessDeviceArrival(incoming_device); + } + + default : + { + break; + } + } + + return NO_ERROR; + } default : - break; + return ERROR_CALL_NOT_IMPLEMENTED; }; - SetServiceStatus(service_status_handle, &service_status); + /*SetServiceStatus(service_status_handle, &service_status);*/ +} + +BOOL +RegisterForDeviceNotifications() +{ + DEV_BROADCAST_DEVICEINTERFACE notification_filter; + + const GUID wdmaud_guid = {STATIC_KSCATEGORY_WDMAUD}; + + /* FIXME: This currently lists ALL device interfaces... */ + ZeroMemory(¬ification_filter, sizeof(notification_filter)); + notification_filter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE); + notification_filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; + notification_filter.dbcc_classguid = wdmaud_guid; + + device_notification_handle = + RegisterDeviceNotification((HANDLE) service_status_handle, + ¬ification_filter, + DEVICE_NOTIFY_SERVICE_HANDLE | + DEVICE_NOTIFY_ALL_INTERFACE_CLASSES); + + return ( device_notification_handle != NULL ); } VOID CALLBACK ServiceMain(DWORD argc, char** argv) { - service_status_handle = RegisterServiceCtrlHandler(SERVICE_NAME, - ServiceControlHandler); + service_status_handle = RegisterServiceCtrlHandlerEx(SERVICE_NAME, + ServiceControlHandler, + NULL); /* Set these to defaults */ service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; @@ -92,15 +161,22 @@ service_status.dwCurrentState = SERVICE_START_PENDING; SetServiceStatus(service_status_handle, &service_status); - /* We should create the mapped section here along with the mutex to - sync access to the device list... */ - - device_list_mutex = CreateMutex(NULL, FALSE, DEVICE_LIST_MUTEX_NAME); - - if ( ! device_list_mutex) + /* This creates the audio device list and mutex */ + if ( ! CreateAudioDeviceList(AUDIO_LIST_MAX_SIZE) ) { service_status.dwCurrentState = SERVICE_STOPPED; - service_status.dwWin32ExitCode = -1; // ok? + service_status.dwWin32ExitCode = -1; + SetServiceStatus(service_status_handle, &service_status); + return; + } + + /* We want to know when devices are added/removed */ + if ( ! RegisterForDeviceNotifications() ) + { + DestroyAudioDeviceList(); + + service_status.dwCurrentState = SERVICE_STOPPED; + service_status.dwWin32ExitCode = -1; SetServiceStatus(service_status_handle, &service_status); return; } @@ -114,4 +190,5 @@ int main() { StartServiceCtrlDispatcher(service_table); + return 0; } Added: trunk/reactos/base/services/audiosrv/pnp_list_lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/pnp…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp_list_lock.c (added) +++ trunk/reactos/base/services/audiosrv/pnp_list_lock.c Wed Sep 19 08:13:24 2007 @@ -1,0 +1,58 @@ +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/services/audiosrv/list_lock.c + * PURPOSE: Audio Service Plug and Play list locking mechanism + * COPYRIGHT: Copyright 2007 Andrew Greenwood + */ + +#include <windows.h> +#include <assert.h> +#include <audiosrv/audiosrv.h> + +static HANDLE audio_device_list_lock = NULL; + +BOOL +InitializeAudioDeviceListLock() +{ + /* The security stuff is to make sure the mutex can be grabbed by + other processes - is this the best idea though ??? */ + + SECURITY_DESCRIPTOR security_descriptor; + SECURITY_ATTRIBUTES security; + + InitializeSecurityDescriptor(&security_descriptor, SECURITY_DESCRIPTOR_REVISION); + SetSecurityDescriptorDacl(&security_descriptor, TRUE, 0, FALSE); + + security.nLength = sizeof(SECURITY_ATTRIBUTES); + security.lpSecurityDescriptor = &security_descriptor; + security.bInheritHandle = FALSE; + + audio_device_list_lock = CreateMutex(&security, + FALSE, + AUDIO_LIST_LOCK_NAME); + + return ( audio_device_list_lock != NULL ); +} + +VOID +KillAudioDeviceListLock() +{ + CloseHandle(audio_device_list_lock); + audio_device_list_lock = NULL; +} + +VOID +LockAudioDeviceList() +{ + assert( audio_device_list_lock != NULL ); + WaitForSingleObject(audio_device_list_lock, INFINITE); +} + +VOID +UnlockAudioDeviceList() +{ + assert( audio_device_list_lock != NULL ); + ReleaseMutex(audio_device_list_lock); +} + Added: trunk/reactos/base/services/audiosrv/pnp_list_manager.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/pnp…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp_list_manager.c (added) +++ trunk/reactos/base/services/audiosrv/pnp_list_manager.c Wed Sep 19 08:13:24 2007 @@ -1,0 +1,173 @@ +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/services/audiosrv/pnp_list_manager.c + * PURPOSE: Audio Service List Manager + * COPYRIGHT: Copyright 2007 Andrew Greenwood + */ + +#include <assert.h> +#include <audiosrv/audiosrv.h> + + +/* + Device descriptor +*/ + +VOID* +CreateDeviceDescriptor(WCHAR* path, BOOL is_enabled) +{ + PnP_AudioDevice* device; + + int path_length = WideStringSize(path); + int size = sizeof(PnP_AudioDevice) + path_length; + +/* printf("path_length %d, total %d\n", path_length, size);*/ + + device = malloc(size); + + if ( ! device ) + return NULL; + + device->enabled = is_enabled; + memcpy(device->path, path, path_length); + + return device; +} + + +/* + Device list (manager-side) + + The device list is stored in some shared-memory, with a named, global + mutex to provide a locking mechanism (to avoid it from being updated + whilst being read). +*/ + +static HANDLE device_list_file = NULL; +static PnP_AudioHeader* audio_device_list = NULL; + +BOOL +AppendAudioDeviceToList(PnP_AudioDevice* device) +{ + int device_info_size; + + /* Figure out the actual structure size */ + device_info_size = sizeof(PnP_AudioDevice); + device_info_size += WideStringSize(device->path); + + LockAudioDeviceList(); + +/* + printf("list size is %d\n", audio_device_list->size); + printf("device info size is %d bytes\n", device_info_size); +*/ + + /* We DON'T want to overshoot the end of the buffer! */ + if ( audio_device_list->size + device_info_size > audio_device_list->max_size ) + { +/* + printf("max_size would be exceeded! failing\n"); +*/ + return FALSE; + } + + /* Commit the device descriptor to the list */ + memcpy((char*)audio_device_list + audio_device_list->size, + device, + device_info_size); + + /* Update the header */ + audio_device_list->device_count ++; + audio_device_list->size += device_info_size; + + UnlockAudioDeviceList(); + + return TRUE; +} + +BOOL +CreateAudioDeviceList(DWORD max_size) +{ +/* printf("Initializing memory device list lock\n");*/ + + if ( ! InitializeAudioDeviceListLock() ) + { + /*printf("Failed!\n");*/ + return FALSE; + } + + /* Preliminary locking - the list memory will likely be a big + buffer of gibberish at this point so we don't want anyone + turning up before we're ready... */ + LockAudioDeviceList(); + + /* Expose our device list to the world */ + device_list_file = CreateFileMapping(INVALID_HANDLE_VALUE, + NULL, + PAGE_READWRITE, + 0, + max_size, + AUDIO_LIST_NAME); + + if ( ! device_list_file ) + { + /*printf("Creation of audio device list FAILED!\n");*/ + + UnlockAudioDeviceList(); + KillAudioDeviceListLock(); + + return FALSE; + } + + /* Of course, we'll need to access the list ourselves */ + audio_device_list = MapViewOfFile(device_list_file, + FILE_MAP_WRITE, + 0, + 0, + max_size); + + if ( ! audio_device_list ) + { + /*printf("MapViewOfFile FAILED\n");*/ + + CloseHandle(device_list_file); + device_list_file = NULL; + + UnlockAudioDeviceList(); + KillAudioDeviceListLock(); + + return FALSE; + } + + /* Clear the mem to avoid any random stray data */ + memset(audio_device_list, 0, max_size); + + /* Don't want devices to overwrite the list! */ + audio_device_list->size = sizeof(PnP_AudioHeader); + audio_device_list->max_size = max_size; + audio_device_list->device_count = 0; + + UnlockAudioDeviceList(); + + return TRUE; +} + +VOID +DestroyAudioDeviceList() +{ + LockAudioDeviceList(); + + /*printf("Unmapping view\n");*/ + UnmapViewOfFile(audio_device_list); + audio_device_list = NULL; + + /*printf("Closing memory mapped file\n");*/ + CloseHandle(device_list_file); + device_list_file = NULL; + + UnlockAudioDeviceList(); + + /*printf("Killing devlist lock\n");*/ + KillAudioDeviceListLock(); +} Added: trunk/reactos/base/services/audiosrv/pnp_list_manager.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/audiosrv/pnp…
============================================================================== --- trunk/reactos/base/services/audiosrv/pnp_list_manager.h (added) +++ trunk/reactos/base/services/audiosrv/pnp_list_manager.h Wed Sep 19 08:13:24 2007 @@ -1,0 +1,29 @@ +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/services/audiosrv/pnp_list_manager.h + * PURPOSE: Audio Service List Manager + * COPYRIGHT: Copyright 2007 Andrew Greenwood + */ + +#include <assert.h> +#include <audiosrv/audiosrv.h> + +#ifndef PNP_LIST_MANAGER_H +#define PNP_LIST_MANAGER_H + +VOID* +CreateDeviceDescriptor(WCHAR* path, BOOL is_enabled); + +#define DestroyDeviceDescriptor(descriptor) free(descriptor) + +BOOL +AppendAudioDeviceToList(PnP_AudioDevice* device); + +BOOL +CreateAudioDeviceList(DWORD max_size); + +VOID +DestroyAudioDeviceList(); + +#endif Modified: trunk/reactos/dll/win32/winmm/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/driver.c?r…
============================================================================== --- trunk/reactos/dll/win32/winmm/driver.c (original) +++ trunk/reactos/dll/win32/winmm/driver.c Wed Sep 19 08:13:24 2007 @@ -4,6 +4,8 @@ * Copyright 1994 Martin Ayotte * Copyright 1998 Marcus Meissner * Copyright 1999 Eric Pouech + * + * Reformatting and additional comments added by Andrew Greenwood. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -213,17 +215,29 @@ static const WCHAR wszSystemIni[] = {'S','Y','S','T','E','M','.','I','N','I',0}; WCHAR wsznull = '\0'; + /* This takes us as far as Windows NT\CurrentVersion */ lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE, HKLM_BASE, 0, KEY_QUERY_VALUE, &hKey); - if (lRet == ERROR_SUCCESS) { - lRet = RegOpenKeyExW(hKey, sectName, 0, KEY_QUERY_VALUE, &hSecKey); - if (lRet == ERROR_SUCCESS) { + + if (lRet == ERROR_SUCCESS) + { + /* Now we descend into the section name that we were given */ + lRet = RegOpenKeyExW(hKey, sectName, 0, KEY_QUERY_VALUE, &hSecKey); + + if (lRet == ERROR_SUCCESS) + { + /* Retrieve the desired value - this is the filename of the lib */ bufLen = sz; - lRet = RegQueryValueExW(hSecKey, keyName, 0, 0, (void*)buf, &bufLen); - RegCloseKey( hSecKey ); - } + lRet = RegQueryValueExW(hSecKey, keyName, 0, 0, (void*)buf, &bufLen); + RegCloseKey( hSecKey ); + } + RegCloseKey( hKey ); } - if (lRet == ERROR_SUCCESS) return TRUE; + + /* Finish up if we've got what we want from the registry */ + if (lRet == ERROR_SUCCESS) + return TRUE; + /* default to system.ini if we can't find it in the registry, * to support native installations where system.ini is still used */ return GetPrivateProfileStringW(sectName, keyName, &wsznull, buf, sz / sizeof(WCHAR), wszSystemIni); @@ -243,19 +257,38 @@ TRACE("(%s, %08lX);\n", debugstr_w(fn), lParam2); - if ((ptr = strchrW(fn, ' ')) != NULL) { - *ptr++ = '\0'; - while (*ptr == ' ') ptr++; - if (*ptr == '\0') ptr = NULL; + if ((ptr = strchrW(fn, ' ')) != NULL) + { + *ptr++ = '\0'; + + while (*ptr == ' ') + ptr++; + + if (*ptr == '\0') + ptr = NULL; } lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER)); - if (lpDrv == NULL) {cause = "OOM"; goto exit;} - - if ((hModule = LoadLibraryW(fn)) == 0) {cause = "Not a 32 bit lib"; goto exit;} + + if (lpDrv == NULL) + { + cause = "OOM"; + goto exit; + } + + if ((hModule = LoadLibraryW(fn)) == 0) + { + cause = "Not a 32 bit lib"; + goto exit; + } lpDrv->d.d32.lpDrvProc = (DRIVERPROC)GetProcAddress(hModule, "DriverProc"); - if (lpDrv->d.d32.lpDrvProc == NULL) {cause = "no DriverProc"; goto exit;} + + if (lpDrv->d.d32.lpDrvProc == NULL) + { + cause = "no DriverProc"; + goto exit; + } lpDrv->dwFlags = 0; lpDrv->d.d32.hModule = hModule; @@ -285,10 +318,14 @@ } if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, lParam2)) - {cause = "load failed"; goto exit;} + { + cause = "load failed"; + goto exit; + } TRACE("=> %p\n", lpDrv); return lpDrv; + exit: FreeLibrary(hModule); HeapFree(GetProcessHeap(), 0, lpDrv); @@ -347,17 +384,32 @@ TRACE("(%s, %s, 0x%08lx);\n", debugstr_w(lpDriverName), debugstr_w(lpSectionName), lParam); - if (lsn == NULL) { + /* If no section name is specified, either the caller is intending on + opening a driver by filename, or wants to open a user-installable + driver that has an entry in the Drivers32 key in the registry */ + if (lsn == NULL) + { + /* Default registry key */ static const WCHAR wszDrivers32[] = {'D','r','i','v','e','r','s','3','2',0}; - lstrcpynW(libName, lpDriverName, sizeof(libName) / sizeof(WCHAR)); - - if ((lpDrv = DRIVER_TryOpenDriver32(libName, lParam))) - goto the_end; - lsn = wszDrivers32; - } - if (DRIVER_GetLibName(lpDriverName, lsn, libName, sizeof(libName)) && - (lpDrv = DRIVER_TryOpenDriver32(libName, lParam))) - goto the_end; + + lstrcpynW(libName, lpDriverName, sizeof(libName) / sizeof(WCHAR)); + + /* Try and open the driver by filename */ + if ( lpDrv = DRIVER_TryOpenDriver32(libName, lParam) ) + goto the_end; + + /* If we got here, the file wasn't found. So we assume the caller + wanted a driver specified under the Drivers32 registry key */ + lsn = wszDrivers32; + } + + /* Attempt to locate the driver filename in the registry */ + if ( DRIVER_GetLibName(lpDriverName, lsn, libName, sizeof(libName)) ) + { + /* Now we have the filename, we can try and load it */ + if ( lpDrv = DRIVER_TryOpenDriver32(libName, lParam) ) + goto the_end; + } /* now we will try a 16 bit driver (and add all the glue to make it work... which * is located in our mmsystem implementation) Modified: trunk/reactos/dll/win32/winmm/lolvldrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winmm/lolvldrv.c…
============================================================================== --- trunk/reactos/dll/win32/winmm/lolvldrv.c (original) +++ trunk/reactos/dll/win32/winmm/lolvldrv.c Wed Sep 19 08:13:24 2007 @@ -4,6 +4,7 @@ * MMSYTEM low level drivers handling functions * * Copyright 1999 Eric Pouech + * Modified for use with ReactOS by Andrew Greenwood, 2007 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public Modified: trunk/reactos/include/psdk/dbt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dbt.h?rev=291…
============================================================================== --- trunk/reactos/include/psdk/dbt.h (original) +++ trunk/reactos/include/psdk/dbt.h Wed Sep 19 08:13:24 2007 @@ -20,6 +20,7 @@ #define DBT_DEVTYP_VOLUME 2 #define DBT_DEVTYP_PORT 3 #define DBT_DEVTYP_NET 4 +#define DBT_DEVTYP_DEVICEINTERFACE 5 #define DBT_APPYBEGIN 0 #define DBT_APPYEND 1 #define DBT_DEVNODES_CHANGED 7 @@ -101,6 +102,13 @@ DWORD dbcv_unitmask; WORD dbcv_flags; } DEV_BROADCAST_VOLUME,*PDEV_BROADCAST_VOLUME; +typedef struct _DEV_BROADCAST_DEVICEINTERFACE { + DWORD dbcc_size; + DWORD dbcc_devicetype; + DWORD dbcc_reserved; + GUID dbcc_classguid; + TCHAR dbcc_name[1]; +} DEV_BROADCAST_DEVICEINTERFACE, *PDEV_BROADCAST_DEVICEINTERFACE; #ifdef UNICODE typedef DEV_BROADCAST_PORT_W DEV_BROADCAST_PORT, *PDEV_BROADCAST_PORT; Added: trunk/reactos/include/reactos/libs/audiosrv/audiosrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/audio…
============================================================================== --- trunk/reactos/include/reactos/libs/audiosrv/audiosrv.h (added) +++ trunk/reactos/include/reactos/libs/audiosrv/audiosrv.h Wed Sep 19 08:13:24 2007 @@ -1,0 +1,60 @@ +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: include/reactos/libs/audiosrv/audiosrv.h + * PURPOSE: Audio Service Plug and Play list + * COPYRIGHT: Copyright 2007 Andrew Greenwood + */ + +#include <windows.h> + +#ifndef AUDIOSRV_H +#define AUDIOSRV_H + +/* This is currently set to avoid conflicting service names in Windows! */ +#define SERVICE_NAME L"RosAudioSrv" + +/* A named mutex is used for synchronizing access to the device list. + If this mutex doesn't exist, it means the audio service isn't running. */ +#define AUDIO_LIST_LOCK_NAME L"Global\\AudioDeviceListLock" + +/* ...and this is where the device list will be available */ +#define AUDIO_LIST_NAME L"Global\\AudioDeviceList" + +/* Amount of shared memory to allocate */ +#define AUDIO_LIST_MAX_SIZE 65536 + +typedef struct +{ + DWORD enabled; + WCHAR path[]; /* The device object path (excluded from sizeof) */ +} PnP_AudioDevice; + +typedef struct +{ + DWORD size; /* Size of the shared mem */ + DWORD max_size; /* Amount of mem available */ + DWORD device_count; /* Number of devices */ + PnP_AudioDevice first_device[]; +} PnP_AudioHeader; + + +/* Calculate amount of memory consumed by a wide string - this includes the + terminating NULL. */ + +#define WideStringSize(str) \ + ( (lstrlenW(str) + 1) * sizeof(WCHAR) ) + +BOOL +InitializeAudioDeviceListLock(); + +VOID +KillAudioDeviceListLock(); + +VOID +LockAudioDeviceList(); + +VOID +UnlockAudioDeviceList(); + +#endif
[View Less]
17 years, 9 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
59
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200