ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2008
----- 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
25 participants
761 discussions
Start a n
N
ew thread
[silverblade] 34299: mmdrv.dll reimplementation begins, with a majority of its functionality shifted into a support library ("mmebuddy") for future reuse with sndblst and likely the WDM audio system. Locating NT4 sound devices is possible by 2 methods (search devices belonging to specific service, and brute-force search). Some of the code is very hacky and for testing this compiles as an EXE. No doubt a few bugs are present, however at the moment I'm satisfied (by testing) that the code is doing
by silverblade@svn.reactos.org
Author: silverblade Date: Fri Jul 4 21:43:17 2008 New Revision: 34299 URL:
http://svn.reactos.org/svn/reactos?rev=34299&view=rev
Log: mmdrv.dll reimplementation begins, with a majority of its functionality shifted into a support library ("mmebuddy") for future reuse with sndblst and likely the WDM audio system. Locating NT4 sound devices is possible by 2 methods (search devices belonging to specific service, and brute-force search). Some of the code is very hacky and for testing this compiles as an EXE. No doubt a few bugs are present, however at the moment I'm satisfied (by testing) that the code is doing what it is supposed to do. Added: branches/silverblade-audio/dll/win32/mmdrv/entry.c (with props) branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/ branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/midi/ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/aux.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/entry.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mid.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mod.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxd.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wid.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wod.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/testing.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c (with props) branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c (with props) Modified: branches/silverblade-audio/dll/win32/mmdrv/mmdrv.def branches/silverblade-audio/dll/win32/mmdrv/mmdrv.rbuild branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/main.c branches/silverblade-audio/include/ddk/ntddsnd.h branches/silverblade-audio/lib/drivers/sound/legacy/devname.c branches/silverblade-audio/lib/drivers/sound/sound.rbuild Added: branches/silverblade-audio/dll/win32/mmdrv/entry.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/dll/win32/mmd…
============================================================================== --- branches/silverblade-audio/dll/win32/mmdrv/entry.c (added) +++ branches/silverblade-audio/dll/win32/mmdrv/entry.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,45 @@ +/* + ReactOS Sound System + Default MME Driver + + Purpose: + MME driver entry-point + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmddk.h> +#include <mmebuddy.h> +#include <debug.h> + +APIENTRY LONG +DriverProc( + DWORD driver_id, + HANDLE driver_handle, + UINT message, + LONG parameter1, + LONG parameter2) +{ + switch ( message ) + { + case DRV_LOAD : + DPRINT("DRV_LOAD\n"); + return 1L; + + case DRV_FREE : + DPRINT("DRV_FREE\n"); + return 1L; + + default : + return DefaultDriverProc(driver_id, + driver_handle, + message, + parameter1, + parameter2); + } +} Propchange: branches/silverblade-audio/dll/win32/mmdrv/entry.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/silverblade-audio/dll/win32/mmdrv/mmdrv.def URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/dll/win32/mmd…
============================================================================== --- branches/silverblade-audio/dll/win32/mmdrv/mmdrv.def [iso-8859-1] (original) +++ branches/silverblade-audio/dll/win32/mmdrv/mmdrv.def [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -11,4 +11,13 @@ ;wodMessage@20 ;midMessage@20 ;modMessage@20 +;mxdMessage@20 ;auxMessage@20 +; +; These entries are here for testing purposes only!!!! +; See testing.c +; +Test@0 +TestGetCaps@0 +TestDevEnum@0 +TestThreading@0 Modified: branches/silverblade-audio/dll/win32/mmdrv/mmdrv.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/dll/win32/mmd…
============================================================================== --- branches/silverblade-audio/dll/win32/mmdrv/mmdrv.rbuild [iso-8859-1] (original) +++ branches/silverblade-audio/dll/win32/mmdrv/mmdrv.rbuild [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,9 +1,14 @@ -<module name="mmdrv" type="win32dll" baseaddress="${BASEADDRESS_MMDRV}" installbase="system32" installname="mmdrv.dll" unicode="yes"> - <importlibrary definition="mmdrv.def" /> +<!--module name="mmdrv" type="win32dll" baseaddress="${BASEADDRESS_MMDRV}" installbase="system32" installname="mmdrv.dll" unicode="yes"--> +<module name="mmdrv" type="win32cui" installbase="system32" installname="mmdrv.exe" unicode="yes"> + <!--importlibrary definition="mmdrv.def" /--> + <include base="ReactOS">include/reactos/libs/sound</include> <include base="mmdrv">.</include> - <define name="NDEBUG" /> + <!--define name="NDEBUG" /--> + <library>mmebuddy</library> <library>ntdll</library> <library>kernel32</library> <library>user32</library> <library>winmm</library> + <library>advapi32</library> + <file>entry.c</file> </module> Modified: branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/main.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/drivers/multi…
============================================================================== --- branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/main.c [iso-8859-1] (original) +++ branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/main.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -123,7 +123,7 @@ NTSTATUS result; DbgPrint("Creating sound device\n"); - result = CreateSoundDeviceWithDefaultName(DriverObject, 0, 69, 0, &g_device); + result = CreateSoundDeviceWithDefaultName(DriverObject, WAVE_OUT_DEVICE_TYPE, 0, 0, &g_device); DbgPrint("Request returned status 0x%08x\n", result); Modified: branches/silverblade-audio/include/ddk/ntddsnd.h URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/include/ddk/n…
============================================================================== --- branches/silverblade-audio/include/ddk/ntddsnd.h [iso-8859-1] (original) +++ branches/silverblade-audio/include/ddk/ntddsnd.h [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -29,16 +29,24 @@ /* Device types - (not part of the original DDK header) -*/ - -#define WAVE_IN_DEVICE_TYPE 0 -#define WAVE_OUT_DEVICE_TYPE 1 -#define MIDI_IN_DEVICE_TYPE 2 -#define MIDI_OUT_DEVICE_TYPE 3 -#define MIXER_DEVICE_TYPE 4 + + Not part of the original DDK header, but based on the values stored in + registry by sndblst +*/ + +#define WAVE_IN_DEVICE_TYPE 1 +#define WAVE_OUT_DEVICE_TYPE 2 +#define MIDI_IN_DEVICE_TYPE 3 +#define MIDI_OUT_DEVICE_TYPE 4 #define AUX_DEVICE_TYPE 5 -#define MAX_DEVICE_TYPE AUX_DEVICE_TYPE +#define MIXER_DEVICE_TYPE 6 + +#define MIN_SOUND_DEVICE_TYPE WAVE_IN_DEVICE_TYPE +#define MAX_SOUND_DEVICE_TYPE MIXER_DEVICE_TYPE +#define SOUND_DEVICE_TYPES 6 + +#define VALID_SOUND_DEVICE_TYPE(x) \ + ( ( x >= MIN_SOUND_DEVICE_TYPE ) && ( x <= MAX_SOUND_DEVICE_TYPE ) ) /* @@ -53,35 +61,57 @@ #define SOUND_MAX_DEVICE_NAME 80 -#define DD_WAVE_IN_DEVICE_NAME "\\Device\\WaveIn" -#define DD_WAVE_IN_DEVICE_NAME_U L"\\Device\\WaveIn" -#define DD_WAVE_IN_DOS_DEVICE_NAME "\\DosDevices\\WaveIn" -#define DD_WAVE_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveIn" - -#define DD_WAVE_OUT_DEVICE_NAME "\\Device\\WaveOut" -#define DD_WAVE_OUT_DEVICE_NAME_U L"\\Device\\WaveOut" -#define DD_WAVE_OUT_DOS_DEVICE_NAME "\\DosDevices\\WaveOut" -#define DD_WAVE_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveOut" - -#define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn" -#define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn" -#define DD_MIDI_IN_DOS_DEVICE_NAME "\\DosDevices\\MidiIn" -#define DD_MIDI_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiIn" - -#define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut" -#define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut" -#define DD_MIDI_OUT_DOS_DEVICE_NAME "\\DosDevices\\MidiOut" -#define DD_MIDI_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiOut" - -#define DD_MIX_DEVICE_NAME "\\Device\\MMMix" -#define DD_MIX_DEVICE_NAME_U L"\\Device\\MMMix" -#define DD_MIX_DOS_DEVICE_NAME "\\DosDevices\\MMMix" -#define DD_MIX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMMix" - -#define DD_AUX_DEVICE_NAME "\\Device\\MMAux" -#define DD_AUX_DEVICE_NAME_U L"\\Device\\MMAux" -#define DD_AUX_DOS_DEVICE_NAME "\\DosDevices\\MMAux" -#define DD_AUX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMAux" +#define DD_WAVE_IN_DEVICE_NAME "\\Device\\WaveIn" +#define DD_WAVE_IN_DEVICE_NAME_U L"\\Device\\WaveIn" +#define DD_WAVE_IN_DOS_DEVICE_NAME "\\DosDevices\\WaveIn" +#define DD_WAVE_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveIn" +#define DD_WAVE_IN_WIN32_DEVICE_NAME "\\\\.\\WaveIn" +#define DD_WAVE_IN_WIN32_DEVICE_NAME_U L"\\\\.\\WaveIn" + +#define DD_WAVE_OUT_DEVICE_NAME "\\Device\\WaveOut" +#define DD_WAVE_OUT_DEVICE_NAME_U L"\\Device\\WaveOut" +#define DD_WAVE_OUT_DOS_DEVICE_NAME "\\DosDevices\\WaveOut" +#define DD_WAVE_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveOut" +#define DD_WAVE_OUT_WIN32_DEVICE_NAME "\\\\.\\WaveOut" +#define DD_WAVE_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\WaveOut" + +#define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn" +#define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn" +#define DD_MIDI_IN_DOS_DEVICE_NAME "\\DosDevices\\MidiIn" +#define DD_MIDI_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiIn" +#define DD_MIDI_IN_WIN32_DEVICE_NAME "\\\\.\\MidiIn" +#define DD_MIDI_IN_WIN32_DEVICE_NAME_U L"\\\\.\\MidiIn" + +#define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut" +#define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut" +#define DD_MIDI_OUT_DOS_DEVICE_NAME "\\DosDevices\\MidiOut" +#define DD_MIDI_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiOut" +#define DD_MIDI_OUT_WIN32_DEVICE_NAME "\\\\.\\MidiOut" +#define DD_MIDI_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\MidiOut" + +#define DD_MIX_DEVICE_NAME "\\Device\\MMMix" +#define DD_MIX_DEVICE_NAME_U L"\\Device\\MMMix" +#define DD_MIX_DOS_DEVICE_NAME "\\DosDevices\\MMMix" +#define DD_MIX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMMix" +#define DD_MIX_WIN32_DEVICE_NAME "\\\\.\\MMMix" +#define DD_MIX_WIN32_DEVICE_NAME_U L"\\\\.\\MMMix" + +#define DD_AUX_DEVICE_NAME "\\Device\\MMAux" +#define DD_AUX_DEVICE_NAME_U L"\\Device\\MMAux" +#define DD_AUX_DOS_DEVICE_NAME "\\DosDevices\\MMAux" +#define DD_AUX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMAux" +#define DD_AUX_WIN32_DEVICE_NAME "\\\\.\\MMAux" +#define DD_AUX_WIN32_DEVICE_NAME_U L"\\\\.\\MMAux" + +/* + Registry keys +*/ + +#define REG_SERVICES_KEY_NAME_U L"System\\CurrentControlSet\\Services" +#define REG_PARAMETERS_KEY_NAME_U L"Parameters" +#define REG_DEVICE_KEY_NAME_U L"Device" +#define REG_DEVICES_KEY_NAME_U L"Devices" + /* Base control codes Added: branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/include/react…
============================================================================== --- branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h (added) +++ branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,299 @@ +/* + ReactOS Sound System + MME Support Helper + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created + + Notes: + MME Buddy was the best name I could come up with... +*/ + +#ifndef ROS_AUDIO_MMEBUDDY_H +#define ROS_AUDIO_MMEBUDDY_H + +struct _SOUND_DEVICE; +struct _SOUND_DEVICE_INSTANCE; + + +/* + Rather than pass caps structures around as a PVOID, this can be + used instead. +*/ + +typedef union _UNIVERSAL_CAPS +{ + WAVEOUTCAPS WaveOut; + WAVEINCAPS WaveIn; + MIDIOUTCAPS MidiOut; + MIDIINCAPS MidiIn; +} UNIVERSAL_CAPS, *PUNIVERSAL_CAPS; + + +/* + Thread helper operations +*/ + +typedef MMRESULT (*SOUND_THREAD_OPERATION)( + IN struct _SOUND_DEVICE_INSTANCE* Instance, + IN PVOID Data); + +typedef struct _THREAD_OPERATIONS +{ + struct _THREAD_OPERATIONS* Next; + DWORD Id; + SOUND_THREAD_OPERATION Operation; +} THREAD_OPERATIONS, *PTHREAD_OPERATIONS; + +typedef struct _SOUND_THREAD +{ + HANDLE Handle; + BOOLEAN Running; + PTHREAD_OPERATIONS FirstOperation; + HANDLE KillEvent; + HANDLE RequestEvent; + HANDLE RequestCompletionEvent; +} SOUND_THREAD, *PSOUND_THREAD; + + +/* + Audio device function table +*/ + +typedef MMRESULT (*MMOPEN_FUNC)( + IN UCHAR DeviceType, + IN LPWSTR DevicePath, + OUT PHANDLE Handle); + +typedef MMRESULT (*MMCLOSE_FUNC)( + IN HANDLE Handle); + +typedef MMRESULT (*MMGETCAPS_FUNC)( + IN struct _SOUND_DEVICE* SoundDevice, + OUT PUNIVERSAL_CAPS Capabilities); + +typedef struct _MMFUNCTION_TABLE +{ + MMOPEN_FUNC Open; + MMCLOSE_FUNC Close; + MMGETCAPS_FUNC GetCapabilities; +} MMFUNCTION_TABLE, *PMMFUNCTION_TABLE; + + +/* + Represents an audio device +*/ + +typedef struct _SOUND_DEVICE +{ + struct _SOUND_DEVICE* Next; + struct _SOUND_DEVICE_INSTANCE* FirstInstance; + UCHAR DeviceType; + LPWSTR DevicePath; + HANDLE Handle; + MMFUNCTION_TABLE Functions; +} SOUND_DEVICE, *PSOUND_DEVICE; + + +/* + Represents an individual instance of an audio device +*/ + +typedef struct _SOUND_DEVICE_INSTANCE +{ + struct _SOUND_DEVICE_INSTANCE* Next; + PSOUND_DEVICE Device; + PSOUND_THREAD Thread; +} SOUND_DEVICE_INSTANCE, *PSOUND_DEVICE_INSTANCE; + + +/* + entry.c +*/ + +LONG +DefaultDriverProc( + DWORD driver_id, + HANDLE driver_handle, + UINT message, + LONG parameter1, + LONG parameter2); + + +/* + devices.c +*/ + +ULONG +GetSoundDeviceCount( + UCHAR DeviceType); + +MMRESULT +GetSoundDevice( + IN UCHAR DeviceType, + IN ULONG DeviceIndex, + OUT PSOUND_DEVICE* Device); + +MMRESULT +GetSoundDevicePath( + IN PSOUND_DEVICE SoundDevice, + OUT LPWSTR* DevicePath); + +VOID +DestroyAllSoundDevices(); + +BOOLEAN +DestroySoundDevices( + UCHAR DeviceType); + +BOOLEAN +CreateSoundDevice( + UCHAR DeviceType, + PWSTR DevicePath); + +BOOLEAN +DestroySoundDevice( + UCHAR DeviceType, + ULONG Index); + + +/* + nt4.c +*/ + +typedef BOOLEAN (*SOUND_DEVICE_DETECTED_PROC)( + UCHAR DeviceType, + PWSTR DevicePath, + HANDLE Handle); + +MMRESULT +OpenSoundDriverParametersRegKey( + IN LPWSTR ServiceName, + OUT PHKEY KeyHandle); + +MMRESULT +OpenSoundDeviceRegKey( + IN LPWSTR ServiceName, + IN DWORD DeviceIndex, + OUT PHKEY KeyHandle); + +MMRESULT +EnumerateNt4ServiceSoundDevices( + LPWSTR ServiceName, + UCHAR DeviceType, + SOUND_DEVICE_DETECTED_PROC SoundDeviceDetectedProc); + +MMRESULT +DetectNt4SoundDevices( + UCHAR DeviceType, + PWSTR BaseDevicePath, + SOUND_DEVICE_DETECTED_PROC SoundDeviceDetectedProc); + + +/* + kernel.c +*/ + +MMRESULT +OpenKernelSoundDeviceByName( + PWSTR DeviceName, + DWORD AccessRights, + PHANDLE Handle); + +MMRESULT +OpenKernelSoundDevice( + PSOUND_DEVICE SoundDevice, + DWORD AccessRights); + +MMRESULT +PerformSoundDeviceIo( + PSOUND_DEVICE SoundDevice, + DWORD IoControlCode, + LPVOID InBuffer, + DWORD InBufferSize, + LPVOID OutBuffer, + DWORD OutBufferSize, + LPDWORD BytesReturned, + LPOVERLAPPED Overlapped); + +MMRESULT +ReadSoundDevice( + PSOUND_DEVICE SoundDevice, + DWORD IoControlCode, + LPVOID OutBuffer, + DWORD OutBufferSize, + LPDWORD BytesReturned, + LPOVERLAPPED Overlapped); + +MMRESULT +WriteSoundDevice( + PSOUND_DEVICE SoundDevice, + DWORD IoControlCode, + LPVOID InBuffer, + DWORD InBufferSize, + LPDWORD BytesReturned, + LPOVERLAPPED Overlapped); + + +/* + utility.c +*/ + +ULONG +GetDigitCount( + ULONG Number); + +MMRESULT +Win32ErrorToMmResult(UINT error_code); + + +/* + instances.c +*/ + +MMRESULT +CreateSoundDeviceInstance( + IN PSOUND_DEVICE SoundDevice, + OUT PSOUND_DEVICE_INSTANCE* Instance); + +MMRESULT +DestroySoundDeviceInstance( + IN PSOUND_DEVICE_INSTANCE Instance); + +MMRESULT +DestroyAllInstancesOfSoundDevice( + IN PSOUND_DEVICE SoundDevice); + + +/* + ... +*/ + +MMRESULT +GetSoundDeviceCapabilities( + IN PSOUND_DEVICE Device, + OUT PUNIVERSAL_CAPS Capabilities); + +MMRESULT +DefaultGetSoundDeviceCapabilities( + IN PSOUND_DEVICE Device, + OUT PUNIVERSAL_CAPS Capabilities); + + +/* + thread.c +*/ + +MMRESULT +StartSoundThread( + IN PSOUND_DEVICE_INSTANCE Instance); + +MMRESULT +StopSoundThread( + IN PSOUND_DEVICE_INSTANCE Instance); + + +#endif Propchange: branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/silverblade-audio/lib/drivers/sound/legacy/devname.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/legacy/devname.c [iso-8859-1] (original) +++ branches/silverblade-audio/lib/drivers/sound/legacy/devname.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -167,7 +167,7 @@ OUT PCWSTR* DeviceNameBody, OUT PCWSTR* DosDeviceNameBody) { - if ( DeviceType > MAX_DEVICE_TYPE ) + if ( ! VALID_SOUND_DEVICE_TYPE(DeviceType) ) { DPRINT("Invalid device type"); return STATUS_INVALID_PARAMETER; Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,325 @@ +/* + ReactOS Sound System + MME Driver Helper + + Purpose: + Device list manager + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + + +/* + TODO: Free up devicepath on exit +*/ + +#include <windows.h> +#include <ntddsnd.h> +#include <debug.h> + +#include <mmebuddy.h> + +/* Device Lists */ +ULONG SoundDeviceTotals[SOUND_DEVICE_TYPES]; +PSOUND_DEVICE SoundDeviceLists[SOUND_DEVICE_TYPES]; + + +ULONG +GetSoundDeviceCount( + UCHAR DeviceType) +{ + if ( ! VALID_SOUND_DEVICE_TYPE(DeviceType) ) + { + return 0; + } + + return SoundDeviceTotals[DeviceType]; +} + + +MMRESULT +GetSoundDevice( + IN UCHAR DeviceType, + IN ULONG DeviceIndex, + OUT PSOUND_DEVICE* Device) +{ + ULONG Count = 0; + PSOUND_DEVICE CurrentDevice = NULL; + + if ( ! VALID_SOUND_DEVICE_TYPE(DeviceType) ) + return MMSYSERR_INVALPARAM; + + if ( DeviceIndex >= SoundDeviceTotals[DeviceType - MIN_SOUND_DEVICE_TYPE] ) + return MMSYSERR_INVALPARAM; + + if ( ! Device ) + return MMSYSERR_INVALPARAM; + + /* + We know by now that a device at the index should exist + so just loop around until we reach that index. + */ + + CurrentDevice = SoundDeviceLists[DeviceType - MIN_SOUND_DEVICE_TYPE]; + + for ( Count = 0; Count <= DeviceIndex; ++ Count ) + { + *Device = CurrentDevice; + CurrentDevice = CurrentDevice->Next; + } + + return MMSYSERR_NOERROR; +} + + +MMRESULT +GetSoundDevicePath( + IN PSOUND_DEVICE SoundDevice, + OUT LPWSTR* DevicePath) +{ + if ( ! SoundDevice ) + return MMSYSERR_INVALPARAM; + + if ( ! DevicePath ) + return MMSYSERR_INVALPARAM; + + MessageBox(0, SoundDevice->DevicePath, L"Foo", MB_TASKMODAL | MB_OK); + *DevicePath = SoundDevice->DevicePath; + + return MMSYSERR_NOERROR; +} + + +VOID +DestroyAllSoundDevices() +{ + ULONG i; + + DPRINT("Emptying all device lists\n"); + + for ( i = 0; i < SOUND_DEVICE_TYPES; ++ i ) + { + DestroySoundDevices(i); + } +} + + +BOOLEAN +DestroySoundDevices( + UCHAR DeviceType) +{ + PSOUND_DEVICE CurrentDevice; + PSOUND_DEVICE NextDevice; + + DPRINT("Emptying device list for device type %d\n", DeviceType); + + if ( ! VALID_SOUND_DEVICE_TYPE(DeviceType) ) + { + DPRINT("Invalid device type - %d\n", DeviceType); + return FALSE; + } + + /* Clean out the device list */ + CurrentDevice = SoundDeviceLists[DeviceType - MIN_SOUND_DEVICE_TYPE]; + + while ( CurrentDevice ) + { + /* Save the next device pointer so we can reference it later */ + NextDevice = CurrentDevice->Next; + + HeapFree(GetProcessHeap(), 0, CurrentDevice); + CurrentDevice = NextDevice; + } + + /* Reset the list content and item count */ + SoundDeviceLists[DeviceType - MIN_SOUND_DEVICE_TYPE] = NULL; + SoundDeviceTotals[DeviceType - MIN_SOUND_DEVICE_TYPE] = 0; + + return TRUE; +} + + +VOID +InitSoundDeviceFunctionTable( + IN PSOUND_DEVICE Device) +{ + Device->Functions.GetCapabilities = DefaultGetSoundDeviceCapabilities; +} + + +BOOLEAN +CreateSoundDevice( + UCHAR DeviceType, + LPWSTR DevicePath) +{ + PSOUND_DEVICE NewDevice; + ULONG DevicePathSize = 0; + UCHAR TypeIndex; + + DPRINT("Adding a sound device to list %d\n", DeviceType); + + if ( ! VALID_SOUND_DEVICE_TYPE(DeviceType) ) + { + return FALSE; + } + + TypeIndex = DeviceType - MIN_SOUND_DEVICE_TYPE; + + NewDevice = (PSOUND_DEVICE) + HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SOUND_DEVICE)); + + if ( ! NewDevice ) + { + return FALSE; + } + + DevicePathSize = (wcslen(DevicePath) + 1) * sizeof(WCHAR); + + NewDevice->Next = NULL; + NewDevice->FirstInstance = NULL; + NewDevice->DeviceType = DeviceType; + NewDevice->Handle = INVALID_HANDLE_VALUE; + + NewDevice->DevicePath = (LPWSTR) + HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, DevicePathSize); + + if ( ! NewDevice->DevicePath ) + { + HeapFree(GetProcessHeap(), 0, NewDevice); + return FALSE; + } + + CopyMemory(NewDevice->DevicePath, DevicePath, DevicePathSize); + + /* Set up function table */ + InitSoundDeviceFunctionTable(NewDevice); + + /* Start or add to list */ + if ( ! SoundDeviceLists[TypeIndex] ) + { + DPRINT("Starting device list\n"); + SoundDeviceLists[TypeIndex] = NewDevice; + } + else + { + PSOUND_DEVICE CurrentDevice = SoundDeviceLists[TypeIndex]; + + DPRINT("Adding to device list\n"); + + while ( CurrentDevice != NULL ) + { + if ( ! CurrentDevice->Next ) + { + CurrentDevice->Next = NewDevice; + break; + } + + CurrentDevice = CurrentDevice->Next; + } + } + + ++ SoundDeviceTotals[TypeIndex]; + DPRINT("Now %d devices of type %d\n", SoundDeviceTotals[TypeIndex], DeviceType); + + return TRUE; +} + + +BOOLEAN +DestroySoundDevice( + UCHAR DeviceType, + ULONG Index) +{ + ULONG Counter = 0; + ULONG TypeIndex; + PSOUND_DEVICE CurrentDevice = NULL; + PSOUND_DEVICE PreviousDevice = NULL; + + DPRINT("Removing a sound device from list %d\n", DeviceType); + + if ( ! VALID_SOUND_DEVICE_TYPE(DeviceType) ) + { + return FALSE; + } + + TypeIndex = DeviceType - MIN_SOUND_DEVICE_TYPE; + + CurrentDevice = SoundDeviceLists[TypeIndex]; + PreviousDevice = NULL; + + while ( CurrentDevice ) + { + if ( Counter == Index ) + { + /* Clean up any instances */ + if ( CurrentDevice->FirstInstance != NULL ) + { + DestroyAllInstancesOfSoundDevice(CurrentDevice); + } + + /* Close handle (if open) */ + if ( CurrentDevice->Handle != INVALID_HANDLE_VALUE ) + { + CloseHandle(CurrentDevice->Handle); + CurrentDevice->Handle = INVALID_HANDLE_VALUE; + } + + if ( ! PreviousDevice ) + { + /* Head of list */ + SoundDeviceLists[TypeIndex] = CurrentDevice->Next; + } + else + { + /* Not the head of list */ + PreviousDevice->Next = CurrentDevice->Next; + } + + /* Free the memory associated with the device info */ + HeapFree(GetProcessHeap(), 0, CurrentDevice); + CurrentDevice = NULL; + + DPRINT("Removal succeeded\n"); + + return TRUE; + } + + PreviousDevice = CurrentDevice; + ++ Counter; + } + + DPRINT("Not found\n"); + /* Not found */ + return FALSE; +} + + + +/* Should this go somewhere else? */ + +MMRESULT +GetSoundDeviceCapabilities( + PSOUND_DEVICE SoundDevice, + PUNIVERSAL_CAPS Capabilities) +{ + if ( ! SoundDevice ) + return MMSYSERR_INVALPARAM; + + if ( ! Capabilities ) + return MMSYSERR_INVALPARAM; + + return SoundDevice->Functions.GetCapabilities(SoundDevice, Capabilities); +} + +MMRESULT +IsSoundDeviceFormatSupported( + IN PSOUND_DEVICE SoundDevice /* what else? */) +{ + /* TODO */ + return MMSYSERR_NOTSUPPORTED; +} + Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,145 @@ +/* + ReactOS Sound System + MME Driver Helper + + Purpose: + Device instance manager + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <ntddsnd.h> +#include <debug.h> + +#include <mmebuddy.h> + +/* + Instances +*/ + +MMRESULT +CreateSoundDeviceInstance( + IN PSOUND_DEVICE SoundDevice, + OUT PSOUND_DEVICE_INSTANCE* Instance) +{ + PSOUND_DEVICE_INSTANCE NewInstance = NULL; + PSOUND_DEVICE_INSTANCE CurrentInstance = NULL; + + if ( ! SoundDevice ) + return MMSYSERR_INVALPARAM; + + if ( ! Instance ) + return MMSYSERR_INVALPARAM; + + NewInstance = (PSOUND_DEVICE_INSTANCE) + HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SOUND_DEVICE_INSTANCE)); + + if ( ! NewInstance ) + return MMSYSERR_NOMEM; + + /* Initialise */ + NewInstance->Next = NULL; + NewInstance->Device = SoundDevice; + + /* Search for an appropriate place in the list to put this instance */ + CurrentInstance = SoundDevice->FirstInstance; + + if ( ! CurrentInstance ) + { + /* This is going to be the first instance */ + SoundDevice->FirstInstance = CurrentInstance; + } + else + { + /* There is already one or more instances */ + while ( CurrentInstance ) + { + if ( ! CurrentInstance->Next ) + { + /* Add to the end and get outta here */ + CurrentInstance->Next = NewInstance; + break; + } + + CurrentInstance = CurrentInstance->Next; + } + } + + /* Fill the output parameter with this */ + *Instance = NewInstance; + + return MMSYSERR_NOERROR; +} + +MMRESULT +DestroySoundDeviceInstance( + IN PSOUND_DEVICE_INSTANCE Instance) +{ + PSOUND_DEVICE_INSTANCE CurrentInstance = NULL; + PSOUND_DEVICE SoundDevice = NULL; + + if ( ! Instance ) + return MMSYSERR_INVALPARAM; + + SoundDevice = Instance->Device; + + /* TODO - Perform cleanup, stop playback etc. */ + + if ( SoundDevice->FirstInstance == Instance ) + { + /* Deleting the first instance */ + SoundDevice->FirstInstance = NULL; + } + else + { + /* Deleting an instance beyond the first */ + CurrentInstance = SoundDevice->FirstInstance; + + /* If we hit the end of the list, evidently there's a bug */ + while ( CurrentInstance->Next != Instance ) + { + CurrentInstance = CurrentInstance->Next; + ASSERT(CurrentInstance); + } + + /* This is actually the one before the one we want to remove */ + CurrentInstance->Next = Instance->Next; + } + + /* Kill it! */ + HeapFree(GetProcessHeap(), 0, Instance); + + return MMSYSERR_NOTSUPPORTED; +} + +MMRESULT +DestroyAllInstancesOfSoundDevice( + IN PSOUND_DEVICE SoundDevice) +{ + PSOUND_DEVICE_INSTANCE CurrentInstance = NULL; + PSOUND_DEVICE_INSTANCE NextInstance = NULL; + MMRESULT Result; + + if ( ! SoundDevice ) + return MMSYSERR_INVALPARAM; + + CurrentInstance = SoundDevice->FirstInstance; + + while ( CurrentInstance ) + { + NextInstance = CurrentInstance->Next; + + Result = DestroySoundDeviceInstance(CurrentInstance); + ASSERT(Result == MMSYSERR_NOERROR); + } + + return MMSYSERR_NOERROR; +} + Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,181 @@ +/* + ReactOS Sound System + MME Driver Helper + + Purpose: + Kernel device I/O + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <ntddsnd.h> +#include <debug.h> + +#include <mmebuddy.h> + + +MMRESULT +OpenKernelSoundDeviceByName( + PWSTR DeviceName, + DWORD AccessRights, + PHANDLE Handle) +{ + DWORD OpenFlags = 0; + + if ( ! Handle ) + { + return MMSYSERR_INVALPARAM; + } + + if ( ! DeviceName ) + { + return MMSYSERR_INVALPARAM; + } + + if ( AccessRights != GENERIC_READ ) + { + OpenFlags = FILE_FLAG_OVERLAPPED; + } + + DPRINT("Attempting to open '%ws'\n", DeviceName); + MessageBox(0, DeviceName, L"Attempting to open", MB_OK | MB_TASKMODAL); + + *Handle = CreateFile(DeviceName, + AccessRights, + FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + OpenFlags, + NULL); + + if ( *Handle == INVALID_HANDLE_VALUE ) + { + return Win32ErrorToMmResult(GetLastError()); + } + + return MMSYSERR_NOERROR; +} + +MMRESULT +OpenKernelSoundDevice( + PSOUND_DEVICE SoundDevice, + DWORD AccessRights) +{ + MMRESULT Result; + + if ( ! SoundDevice ) + return MMSYSERR_INVALPARAM; + + Result = OpenKernelSoundDeviceByName(SoundDevice->DevicePath, + AccessRights, + &SoundDevice->Handle); + + return Result; +} + +MMRESULT +PerformSoundDeviceIo( + PSOUND_DEVICE SoundDevice, + DWORD IoControlCode, + LPVOID InBuffer, + DWORD InBufferSize, + LPVOID OutBuffer, + DWORD OutBufferSize, + LPDWORD BytesReturned, + LPOVERLAPPED Overlapped) +{ + BOOLEAN TemporaryOpen = FALSE; + BOOLEAN IoResult = FALSE; + DWORD AccessRights = GENERIC_READ; + MMRESULT Result; + + if ( ! SoundDevice ) + return MMSYSERR_INVALPARAM; + + /* Determine if we actually need to write stuff */ + if ( InBuffer != NULL ) + AccessRights |= GENERIC_WRITE; + + /* Open the device temporarily,if it's not open */ + TemporaryOpen = (SoundDevice->Handle == INVALID_HANDLE_VALUE); + + if ( TemporaryOpen ) + { + MessageBox(0, L"Opening sound device", L"Info", MB_OK | MB_TASKMODAL); + + Result = OpenKernelSoundDevice(SoundDevice, AccessRights); + + if ( Result != MMSYSERR_NOERROR ) + return Result; + } + + MessageBox(0, L"Doing IO", L"Info", MB_OK | MB_TASKMODAL); + IoResult = DeviceIoControl( + SoundDevice->Handle, + IoControlCode, + InBuffer, + InBufferSize, + OutBuffer, + OutBufferSize, + BytesReturned, + Overlapped); + + if ( ! IoResult ) + { + return Win32ErrorToMmResult(GetLastError()); + } + + /* If we opened the device, we must close it here */ + if ( TemporaryOpen ) + { + MessageBox(0, L"Closing sound device", L"Info", MB_OK | MB_TASKMODAL); + CloseHandle(SoundDevice->Handle); + SoundDevice->Handle = INVALID_HANDLE_VALUE; + } + + return MMSYSERR_NOERROR; +} + +MMRESULT +ReadSoundDevice( + PSOUND_DEVICE SoundDevice, + DWORD IoControlCode, + LPVOID OutBuffer, + DWORD OutBufferSize, + LPDWORD BytesReturned, + LPOVERLAPPED Overlapped) +{ + return PerformSoundDeviceIo(SoundDevice, + IoControlCode, + NULL, + 0, + OutBuffer, + OutBufferSize, + BytesReturned, + Overlapped); +} + +MMRESULT +WriteSoundDevice( + PSOUND_DEVICE SoundDevice, + DWORD IoControlCode, + LPVOID InBuffer, + DWORD InBufferSize, + LPDWORD BytesReturned, + LPOVERLAPPED Overlapped) +{ + return PerformSoundDeviceIo(SoundDevice, + IoControlCode, + InBuffer, + InBufferSize, + NULL, + 0, + BytesReturned, + Overlapped); +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/aux.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/aux.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/aux.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,31 @@ +/* + ReactOS Sound System + MME Interface + + Purpose: + Auxiliary device message handler + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <mmddk.h> +#include <debug.h> + +APIENTRY DWORD +auxMessage( + DWORD device_id, + DWORD message, + DWORD private_handle, + DWORD parameter1, + DWORD parameter2) +{ + DPRINT("auxMessageStub called\n"); + /* TODO */ + return MMSYSERR_NOTSUPPORTED; +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/aux.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/entry.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/entry.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/entry.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,77 @@ +/* + ReactOS Sound System + MME Interface + + Purpose: + Default DriverProc implementation + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmddk.h> +#include <ntddsnd.h> +#include <debug.h> + +LONG +DefaultDriverProc( + DWORD driver_id, + HANDLE driver_handle, + UINT message, + LONG parameter1, + LONG parameter2) +{ + switch ( message ) + { + case DRV_LOAD : + DPRINT("DRV_LOAD\n"); + return 1L; + + case DRV_FREE : + DPRINT("DRV_FREE\n"); + return 1L; + + case DRV_OPEN : + DPRINT("DRV_OPEN\n"); + return 1L; + + case DRV_CLOSE : + DPRINT("DRV_CLOSE\n"); + return 1L; + + case DRV_ENABLE : + DPRINT("DRV_ENABLE\n"); + return 1L; + + case DRV_DISABLE : + DPRINT("DRV_DISABLE\n"); + return 1L; + + /* + We don't provide configuration capabilities. This used to be + for things like I/O port, IRQ, DMA settings, etc. + */ + + case DRV_QUERYCONFIGURE : + DPRINT("DRV_QUERYCONFIGURE\n"); + return 0L; + + case DRV_CONFIGURE : + DPRINT("DRV_CONFIGURE\n"); + return 0L; + + case DRV_INSTALL : + DPRINT("DRV_INSTALL\n"); + return DRVCNF_RESTART; + }; + + return DefDriverProc(driver_id, + driver_handle, + message, + parameter1, + parameter2); +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/entry.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mid.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mid.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mid.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,49 @@ +/* + ReactOS Sound System + MME Interface + + Purpose: + MIDI Input device message handler + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <mmddk.h> +#include <debug.h> + +APIENTRY DWORD +midMessage( + DWORD device_id, + DWORD message, + DWORD private_handle, + DWORD parameter1, + DWORD parameter2) +{ + DPRINT("midMessageStub called\n"); + + switch ( message ) + { + case MIDM_GETNUMDEVS : + return 0; + + case MIDM_GETDEVCAPS : + case MIDM_OPEN : + return MMSYSERR_BADDEVICEID; + + case MIDM_CLOSE : + case MIDM_ADDBUFFER : + case MIDM_START : + case MIDM_STOP : + case MIDM_RESET : + return MMSYSERR_INVALHANDLE; + + default : + return MMSYSERR_NOTSUPPORTED; + } +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mid.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mod.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mod.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mod.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,48 @@ +/* + ReactOS Sound System + MME Interface + + Purpose: + MIDI Output device message handler + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <mmddk.h> +#include <debug.h> + +APIENTRY DWORD +modMessage( + DWORD device_id, + DWORD message, + DWORD private_handle, + DWORD parameter1, + DWORD parameter2) +{ + DPRINT("modMessageStub called\n"); + + switch ( message ) + { + case MODM_GETNUMDEVS : + return 0; + + case MODM_GETDEVCAPS : + case MODM_OPEN : + return MMSYSERR_BADDEVICEID; + + case MODM_CLOSE : + case MODM_DATA : + case MODM_LONGDATA : + case MODM_RESET : + return MMSYSERR_INVALHANDLE; + + default : + return MMSYSERR_NOTSUPPORTED; + } +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mod.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxd.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxd.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxd.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,31 @@ +/* + ReactOS Sound System + MME Interface + + Purpose: + Mixer device message handler + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <mmddk.h> +#include <debug.h> + +APIENTRY DWORD +mxdMessage( + DWORD device_id, + DWORD message, + DWORD private_handle, + DWORD parameter1, + DWORD parameter2) +{ + DPRINT("mxdMessageStub called\n"); + /* TODO */ + return MMSYSERR_NOTSUPPORTED; +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxd.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wid.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wid.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wid.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,50 @@ +/* + ReactOS Sound System + MME Interface + + Purpose: + Wave input device message handler + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <mmddk.h> +#include <debug.h> +#include <ntddsnd.h> + +#include <mmebuddy.h> + +APIENTRY DWORD +widMessage( + DWORD device_id, + DWORD message, + DWORD private_handle, + DWORD parameter1, + DWORD parameter2) +{ + DPRINT("widMessageStub called\n"); + + switch ( message ) + { + case WIDM_GETNUMDEVS : + return GetSoundDeviceCount(WAVE_IN_DEVICE_TYPE); + + case WIDM_GETDEVCAPS : + case WIDM_OPEN : + return MMSYSERR_BADDEVICEID; + + case WIDM_CLOSE : + case WIDM_START : + case WIDM_RESET : + return MMSYSERR_INVALHANDLE; + + default : + return MMSYSERR_NOTSUPPORTED; + } +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wid.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wod.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wod.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wod.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,81 @@ +/* + ReactOS Sound System + MME Interface + + Purpose: + Wave output device message handler + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <mmddk.h> +#include <debug.h> + +#include <ntddsnd.h> +#include <mmebuddy.h> + +APIENTRY DWORD +wodMessage( + DWORD device_id, + DWORD message, + DWORD private_handle, + DWORD parameter1, + DWORD parameter2) +{ + MMRESULT Result = MMSYSERR_NOERROR; + PSOUND_DEVICE Device = NULL; + DPRINT("wodMessageStub called\n"); + + switch ( message ) + { + case WODM_GETNUMDEVS : + return GetSoundDeviceCount(WAVE_OUT_DEVICE_TYPE); + + case WODM_GETDEVCAPS : + { + UNIVERSAL_CAPS Capabilities; + + Result = GetSoundDevice(WAVE_OUT_DEVICE_TYPE, device_id, &Device); + if ( Result != MMSYSERR_NOERROR ) + return Result; + + Result = GetSoundDeviceCapabilities(Device, &Capabilities); + if ( Result != MMSYSERR_NOERROR ) + return Result; + + CopyMemory((LPWAVEOUTCAPS)parameter1, &Capabilities.WaveOut, parameter2); + + return Result; + } + + case WODM_OPEN : + /* + OpenSoundDevice(); + */ + return MMSYSERR_BADDEVICEID; + + case WODM_CLOSE : + /* CloseSoundDevice() */ + + case WODM_WRITE : + case WODM_PAUSE : + case WODM_RESTART : + case WODM_RESET : + case WODM_BREAKLOOP : + return MMSYSERR_INVALHANDLE; + + /* Let WINMM take care of these */ + case WODM_PREPARE : + case WODM_UNPREPARE : + return MMSYSERR_NOTSUPPORTED; + + default : + return MMSYSERR_NOTSUPPORTED; + } +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wod.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,26 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> +<module name="mmebuddy" type="staticlibrary" allowwarnings="false" unicode="yes"> + <include base="ReactOS">include/reactos/libs/sound</include> + <file>devices.c</file> + <file>instances.c</file> + <file>kernel.c</file> + <file>nt4.c</file> + <file>utility.c</file> + <file>thread.c</file> + <file>testing.c</file> + <directory name="mme"> + <file>entry.c</file> + <file>wod.c</file> + <file>wid.c</file> + <file>mod.c</file> + <file>mid.c</file> + <file>mxd.c</file> + <file>aux.c</file> + </directory> + <directory name="wave"> + <file>wavethread.c</file> + </directory> + <directory name="midi"> + </directory> +</module> Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,429 @@ +/* + ReactOS Sound System + MME Driver Helper + + Purpose: + Legacy (NT4) sound device support + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +/* + A better way of detecting sound devices... + Search the appropriate registry key! +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <ntddsnd.h> +#include <debug.h> + +#include <mmebuddy.h> + +/* + Open the parameters key of a sound driver. + NT4 only. +*/ +MMRESULT +OpenSoundDriverParametersRegKey( + IN LPWSTR ServiceName, + OUT PHKEY KeyHandle) +{ + ULONG KeyLength; + PWCHAR ParametersKeyName; + + if ( ! ServiceName ) + return MMSYSERR_INVALPARAM; + + if ( ! KeyHandle ) + return MMSYSERR_INVALPARAM; + + /* Work out how long the string will be */ + KeyLength = wcslen(REG_SERVICES_KEY_NAME_U) + 1 + + wcslen(ServiceName) + 1 + + wcslen(REG_PARAMETERS_KEY_NAME_U) + 1; + + KeyLength *= sizeof(WCHAR); + + /* Allocate memory for the string */ + ParametersKeyName = (PWCHAR) HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + KeyLength); + + if ( ! ParametersKeyName ) + return MMSYSERR_NOMEM; + + /* Construct the registry path */ + wsprintf(ParametersKeyName, + L"%s\\%s\\%s", + REG_SERVICES_KEY_NAME_U, + ServiceName, + REG_PARAMETERS_KEY_NAME_U); + + MessageBox(0, ParametersKeyName, L"Parameters key is...", MB_OK | MB_TASKMODAL); + + /* Perform the open */ + if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, + ParametersKeyName, + 0, + KEY_READ, + KeyHandle) != ERROR_SUCCESS ) + { + /* Couldn't open the key */ + HeapFree(GetProcessHeap(), 0, ParametersKeyName); + return MMSYSERR_ERROR; + } + + HeapFree(GetProcessHeap(), 0, ParametersKeyName); + + return MMSYSERR_NOERROR; +} + +/* + Open one of the Device sub-keys belonging to the sound driver. + NT4 only. +*/ +MMRESULT +OpenSoundDeviceRegKey( + IN LPWSTR ServiceName, + IN DWORD DeviceIndex, + OUT PHKEY KeyHandle) +{ + DWORD PathSize; + PWCHAR RegPath; + + if ( ! ServiceName ) + return MMSYSERR_INVALPARAM; + + if ( ! KeyHandle ) + return MMSYSERR_INVALPARAM; + + /* + Work out the space required to hold the path: + + HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ + sndblst\ + Parameters\ + Device123\ + */ + PathSize = wcslen(REG_SERVICES_KEY_NAME_U) + 1 + + wcslen(ServiceName) + 1 + + wcslen(REG_PARAMETERS_KEY_NAME_U) + 1 + + wcslen(REG_DEVICE_KEY_NAME_U) + + GetDigitCount(DeviceIndex) + 1; + + PathSize *= sizeof(WCHAR); + + /* Allocate storage for the string */ + RegPath = (PWCHAR) HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + PathSize); + + if ( ! RegPath ) + { + return MMSYSERR_NOMEM; + } + + /* Write the path */ + wsprintf(RegPath, + L"%ls\\%ls\\%ls\\%ls%d", + REG_SERVICES_KEY_NAME_U, + ServiceName, + REG_PARAMETERS_KEY_NAME_U, + REG_DEVICE_KEY_NAME_U, + DeviceIndex); + + MessageBox(0, RegPath, L"Opening registry path", MB_OK | MB_TASKMODAL); + + /* Perform the open */ + if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, + RegPath, + 0, + KEY_READ, + KeyHandle) != ERROR_SUCCESS ) + { + /* Couldn't open the key */ + HeapFree(GetProcessHeap(), 0, RegPath); + return MMSYSERR_ERROR; + } + + HeapFree(GetProcessHeap(), HEAP_ZERO_MEMORY, RegPath); + + return MMSYSERR_NOERROR; +} + +/* + This is the "nice" way to discover audio devices in NT4 - go into the + service registry key and enumerate the Parameters\Device*\Devices + values. The value names represent the device name, whereas the data + assigned to them identifies the type of device. +*/ +MMRESULT +EnumerateNt4ServiceSoundDevices( + LPWSTR ServiceName, + UCHAR DeviceType, + SOUND_DEVICE_DETECTED_PROC SoundDeviceDetectedProc) +{ + HKEY Key; + DWORD KeyIndex = 0; + + /* Validate parameters */ + if ( ! ServiceName ) + return MMSYSERR_INVALPARAM; + + if ( ! VALID_SOUND_DEVICE_TYPE(DeviceType) ) + return MMSYSERR_INVALPARAM; + + while ( OpenSoundDeviceRegKey(ServiceName, KeyIndex, &Key) == MMSYSERR_NOERROR ) + { + HKEY DevicesKey; + DWORD ValueType = REG_NONE, ValueIndex = 0; + DWORD MaxNameLength = 0, ValueNameLength = 0; + PWSTR DevicePath = NULL, ValueName = NULL; + DWORD ValueDataLength = sizeof(DWORD); + DWORD ValueData; + + if ( RegOpenKeyEx(Key, + REG_DEVICES_KEY_NAME_U, + 0, + KEY_READ, + &DevicesKey) == ERROR_SUCCESS ) + { + /* Find out how much memory is needed for the key name */ + if ( RegQueryInfoKey(DevicesKey, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, + &MaxNameLength, + NULL, NULL, NULL) != ERROR_SUCCESS ) + { + RegCloseKey(DevicesKey); + RegCloseKey(Key); + + return MMSYSERR_ERROR; + } + + /* Account for terminating NULL */ + ++ MaxNameLength; + + DevicePath = (PWSTR) HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + (MaxNameLength + + strlen("\\\\.\\")) * + sizeof(WCHAR)); + + /* Check that the memory allocation was successful */ + if ( ! DevicePath ) + { + /* There's no point in going further */ + RegCloseKey(DevicesKey); + RegCloseKey(Key); + + return MMSYSERR_NOMEM; + } + + /* Insert the device path prefix */ + wsprintf(DevicePath, L"\\\\.\\"); + + /* The offset of the string following this prefix */ + ValueName = DevicePath + strlen("\\\\.\\"); + + /* Copy this so that it may be overwritten */ + ValueNameLength = MaxNameLength; + + while ( RegEnumValue(DevicesKey, + ValueIndex, + ValueName, + &ValueNameLength, + NULL, + &ValueType, + (LPBYTE) &ValueData, + &ValueDataLength) == ERROR_SUCCESS ) + { + /* Device types are stored as DWORDs */ + if ( ( ValueType == REG_DWORD ) && + ( ValueDataLength == sizeof(DWORD) ) ) + { + SoundDeviceDetectedProc( + DeviceType, + DevicePath, + INVALID_HANDLE_VALUE); + } + + /* Reset variables for the next iteration */ + ValueNameLength = MaxNameLength; + ZeroMemory(ValueName, MaxNameLength); + ValueDataLength = sizeof(DWORD); + ValueData = 0; + ValueType = REG_NONE; + + ++ ValueIndex; + } + + HeapFree(GetProcessHeap(), 0, DevicePath); + + RegCloseKey(DevicesKey); + } + + ++ KeyIndex; + + RegCloseKey(Key); + } + + return MMSYSERR_NOERROR; +} + +/* + Brute-force device detection, using a base device name (eg: \\.\WaveOut). + + This will add the device number as a suffix to the end of the string and + attempt to open the device based on that name. On success, it will + increment the device number and repeat this process. + + When it runs out of devices, it will give up. +*/ +MMRESULT +DetectNt4SoundDevices( + UCHAR DeviceType, + PWSTR BaseDeviceName, + SOUND_DEVICE_DETECTED_PROC SoundDeviceDetectedProc) +{ + ULONG DeviceNameLength = 0; + ULONG DeviceNameSize = 0; + PWSTR DeviceName = NULL; + ULONG Index = 0, Count = 0; + HANDLE DeviceHandle; + BOOLEAN DoSearch = TRUE; + + DPRINT("Detecting NT4 style sound devices of type %d\n", DeviceType); + + if ( ! VALID_SOUND_DEVICE_TYPE(DeviceType) ) + { + return MMSYSERR_INVALPARAM; + } + + DeviceNameLength = wcslen(BaseDeviceName); + /* Consider the length of the number */ + DeviceNameLength += GetDigitCount(Index); + /* ...and the terminating NULL */ + DeviceNameLength += 1; + /* Finally, this is a wide string, so... */ + DeviceNameSize = DeviceNameLength * sizeof(WCHAR); + + DeviceName = (PWSTR) + HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, DeviceNameSize); + + if ( ! DeviceName ) + { + return MMSYSERR_NOMEM; + } + + while ( DoSearch ) + { + /* Nothing like a nice clean device name */ + ZeroMemory(DeviceName, DeviceNameSize); + wsprintf(DeviceName, L"%ls%d", BaseDeviceName, Index); + + if ( OpenKernelSoundDeviceByName(DeviceName, + GENERIC_READ, + &DeviceHandle) == MMSYSERR_NOERROR ) + { + DPRINT("Found device %d\n", Index); + + /* Notify the callback function */ + if ( SoundDeviceDetectedProc(DeviceType, DeviceName, DeviceHandle) ) + { + ++ Count; + } + + CloseHandle(DeviceHandle); + + ++ Index; + } + else + { + DoSearch = FALSE; + } + } + + HeapFree(GetProcessHeap(), 0, DeviceName); + + return MMSYSERR_NOERROR; +} + + +#include <ntddk.h> /* How do I avoid this? */ + +MMRESULT +DefaultGetSoundDeviceCapabilities( + IN PSOUND_DEVICE Device, + OUT PUNIVERSAL_CAPS Capabilities) +{ + PVOID RawCapsPtr = NULL; + ULONG CapsSize = 0; + DWORD Ioctl; + MMRESULT Result; + DWORD BytesReturned; + + ZeroMemory(Capabilities, sizeof(UNIVERSAL_CAPS)); + + if ( ! Device ) + return MMSYSERR_INVALPARAM; + + if ( ! Capabilities ) + return MMSYSERR_INVALPARAM; + + /* Select appropriate IOCTL and capabilities structure */ + switch ( Device->DeviceType ) + { + case WAVE_OUT_DEVICE_TYPE : + Ioctl = IOCTL_WAVE_GET_CAPABILITIES; + RawCapsPtr = (PVOID) &Capabilities->WaveOut; + CapsSize = sizeof(WAVEOUTCAPS); + break; + + case WAVE_IN_DEVICE_TYPE : + Ioctl = IOCTL_WAVE_GET_CAPABILITIES; + RawCapsPtr = (PVOID) &Capabilities->WaveIn; + CapsSize = sizeof(WAVEINCAPS); + break; + + case MIDI_OUT_DEVICE_TYPE : + Ioctl = IOCTL_MIDI_GET_CAPABILITIES; + RawCapsPtr = (PVOID) &Capabilities->MidiOut; + CapsSize = sizeof(MIDIOUTCAPS); + break; + + case MIDI_IN_DEVICE_TYPE : + Ioctl = IOCTL_MIDI_GET_CAPABILITIES; + RawCapsPtr = (PVOID) &Capabilities->MidiIn; + CapsSize = sizeof(MIDIINCAPS); + break; + + case MIXER_DEVICE_TYPE : + /* TODO */ + /*Ioctl = IOCTL_MIX_GET_CAPABILITIES;*/ + return MMSYSERR_NOTSUPPORTED; + + case AUX_DEVICE_TYPE : + /* TODO */ + Ioctl = IOCTL_AUX_GET_CAPABILITIES; + return MMSYSERR_NOTSUPPORTED; + + default : + return MMSYSERR_NOTSUPPORTED; + } + + /* Call the driver */ + Result = ReadSoundDevice( + Device, + Ioctl, + (LPVOID) RawCapsPtr, + CapsSize, + &BytesReturned, + NULL); + + return Result; +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/testing.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/testing.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/testing.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,229 @@ +/* + ReactOS Sound System + MME Driver Helper + + Purpose: + Hax + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> +#include <ntddsnd.h> +#include <debug.h> + +#include <mmebuddy.h> + + +/* + **** TESTING CODE ONLY **** +*/ + +#define IDS_WAVEOUT_PNAME 0x68 + + + +BOOLEAN TestCallback( + UCHAR DeviceType, + PWSTR DevicePath, + HANDLE Handle) +{ + MessageBox(0, DevicePath, L"CALLBACK", MB_OK | MB_TASKMODAL); + + CreateSoundDevice(DeviceType, DevicePath); + + return TRUE; +} + + +APIENTRY VOID +Test() +{ + ULONG WaveInCount, WaveOutCount; + ULONG MidiInCount, MidiOutCount; + ULONG MixerCount, AuxCount; + WCHAR Message[1024]; + + DetectNt4SoundDevices(WAVE_IN_DEVICE_TYPE, + L"\\\\.\\SBWaveIn", + TestCallback); + + DetectNt4SoundDevices(WAVE_OUT_DEVICE_TYPE, + L"\\\\.\\SBWaveOut", + TestCallback); + + DetectNt4SoundDevices(MIDI_IN_DEVICE_TYPE, + L"\\\\.\\MidiIn", + TestCallback); + + DetectNt4SoundDevices(MIDI_OUT_DEVICE_TYPE, + L"\\\\.\\MidiOut", + TestCallback); + + DetectNt4SoundDevices(MIXER_DEVICE_TYPE, + L"\\\\.\\SBMixer", + TestCallback); + + DetectNt4SoundDevices(AUX_DEVICE_TYPE, + L"\\\\.\\SBAux", + TestCallback); + + WaveInCount = GetSoundDeviceCount(WAVE_IN_DEVICE_TYPE); + WaveOutCount = GetSoundDeviceCount(WAVE_OUT_DEVICE_TYPE); + MidiInCount = GetSoundDeviceCount(MIDI_IN_DEVICE_TYPE); + MidiOutCount = GetSoundDeviceCount(MIDI_OUT_DEVICE_TYPE); + MixerCount = GetSoundDeviceCount(MIXER_DEVICE_TYPE); + AuxCount = GetSoundDeviceCount(AUX_DEVICE_TYPE); + + wsprintf(Message, L"Found devices:\n- %d wave inputs\n- %d wave outputs\n- %d midi inputs\n- %d midi outputs\n- %d mixers\n- %d aux devices", + WaveInCount, WaveOutCount, + MidiInCount, MidiOutCount, + MixerCount, AuxCount); + + MessageBox(0, Message, L"Result", MB_OK | MB_TASKMODAL); +} + +APIENTRY VOID +TestGetCaps() +{ + UNIVERSAL_CAPS Caps; + WCHAR DevInfo[1024]; + PSOUND_DEVICE Device; + MMRESULT Result; + + CreateSoundDevice(WAVE_OUT_DEVICE_TYPE, L"\\\\.\\SBWaveOut0"); + Result = GetSoundDevice(WAVE_OUT_DEVICE_TYPE, 0, &Device); + + if ( Result != MMSYSERR_NOERROR ) + { + MessageBox(0, L"Fail 1", L"Fail", MB_OK | MB_TASKMODAL); + return; + } + + Result = GetSoundDeviceCapabilities(Device, &Caps); + if ( Result != MMSYSERR_NOERROR ) + { + MessageBox(0, L"Fail 2", L"Fail", MB_OK | MB_TASKMODAL); + return; + } + + wsprintf(DevInfo, L"Device name: %hS\nManufacturer ID: %d\nProduct ID: %d\nDriver version: %x\nChannels: %d", Caps.WaveOut.szPname, Caps.WaveOut.wMid, Caps.WaveOut.wPid, Caps.WaveOut.vDriverVersion, Caps.WaveOut.wChannels); + + MessageBox(0, DevInfo, L"Result", MB_OK | MB_TASKMODAL); + +#if 0 + HANDLE Handle; + MMRESULT Result; + WAVEOUTCAPS Caps; + DWORD BytesReturned = 0; + WCHAR DevInfo[1024]; + + Result = OpenKernelSoundDevice( + L"\\\\.\\SBWaveOut0", + GENERIC_READ, + &Handle); + + if ( Result != MMSYSERR_NOERROR ) + { + MessageBox(0, L"Fail open", L"Fail open", MB_OK | MB_TASKMODAL); + return; + } + + ZeroMemory(&Caps, sizeof(WAVEOUTCAPS)); + + if ( ! + DeviceIoControl(Handle, + IOCTL_WAVE_GET_CAPABILITIES, + NULL, + 0, + (LPVOID) &Caps, + sizeof(WAVEOUTCAPS), + &BytesReturned, + NULL) ) + { + MessageBox(0, L"Fail", L"Fail", MB_OK | MB_TASKMODAL); + } + else + { + wsprintf(DevInfo, L"%02x %02x %02x %02x %02x %02x", Caps.szPname[0], Caps.szPname[1], Caps.szPname[2], Caps.szPname[3], Caps.szPname[4], Caps.szPname[5]); +/* + wsprintf(DevInfo, L"Device name: %hS\nManufacturer ID: %d\nProduct ID: %d\nDriver version: %x\nChannels: %d", Caps.szPname, Caps.wMid, Caps.wPid, Caps.vDriverVersion, Caps.wChannels); +*/ + + MessageBox(0, DevInfo, L"Result", MB_OK | MB_TASKMODAL); + } + + CloseHandle(Handle); +#endif +} + + + +APIENTRY VOID +TestDevEnum() +{ + EnumerateNt4ServiceSoundDevices( + L"sndblst", + WAVE_OUT_DEVICE_TYPE, + TestCallback); +} + + +WINAPI VOID +TestThreading() +{ + MMRESULT Result; + PSOUND_DEVICE Device; + PSOUND_DEVICE_INSTANCE Instance; + + CreateSoundDevice(WAVE_OUT_DEVICE_TYPE, L"\\\\.\\SBWaveOut0"); + Result = GetSoundDevice(WAVE_OUT_DEVICE_TYPE, 0, &Device); + if ( Result != MMSYSERR_NOERROR ) + { + MessageBox(0, L"Fail 1", L"Fail 1", MB_OK | MB_TASKMODAL); + return; + } + + Result = CreateSoundDeviceInstance(Device, &Instance); + if ( Result != MMSYSERR_NOERROR ) + { + MessageBox(0, L"Fail 2", L"Fail 2", MB_OK | MB_TASKMODAL); + return; + } + + Result = StartSoundThread(Instance); + if ( Result != MMSYSERR_NOERROR ) + { + MessageBox(0, L"Fail 2", L"Fail 2", MB_OK | MB_TASKMODAL); + return; + } + + MessageBox(0, L"Click to kill thread", L"Bai", MB_OK | MB_TASKMODAL); + + StopSoundThread(Instance); +/* + P + +MMRESULT +CreateSoundThread( + IN PSOUND_DEVICE_INSTANCE Instance, + OUT PSOUND_THREAD* Thread); +*/ +} + + +int APIENTRY wWinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPWSTR lpCmdLine, + int nCmdShow) +{ + TestThreading(); + MessageBox(0, L"Le end", L"Bai", MB_OK | MB_TASKMODAL); + return 0; +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/testing.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,230 @@ +/* + ReactOS Sound System + MME Driver Helper + + Purpose: + Sound device processing thread + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +/* + This is used internally by the internal routines + (my, how recursive of you...) +*/ + +#include <windows.h> +#include <mmsystem.h> + +#include <mmebuddy.h> + +DWORD WINAPI +SoundThreadProc( + IN LPVOID lpParameter) +{ + PSOUND_DEVICE_INSTANCE Instance; + PSOUND_THREAD Thread; + HANDLE Events[2]; + + Instance = (PSOUND_DEVICE_INSTANCE) lpParameter; + Thread = Instance->Thread; + + Events[0] = Thread->KillEvent; + Events[1] = Thread->RequestEvent; + + Thread->Running = TRUE; + + MessageBox(0, L"Hi from thread!", L"Hi!", MB_OK | MB_TASKMODAL); + + while ( Thread->Running ) + { + DWORD Signalled = 0; + + Signalled = WaitForMultipleObjects(2, Events, FALSE, INFINITE); + + if ( Signalled == WAIT_OBJECT_0 ) + { + Thread->Running = FALSE; + } + else if ( Signalled == WAIT_OBJECT_0 + 1 ) + { + /* ... */ + } + } + + MessageBox(0, L"Bye from thread!", L"Bye!", MB_OK | MB_TASKMODAL); + + ExitThread(0); + return 0; +} + +MMRESULT +CreateThreadEvents( + IN PSOUND_THREAD Thread) +{ + /* Create the request event */ + Thread->RequestEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + + if ( ! Thread->RequestEvent ) + { + return MMSYSERR_NOMEM; + } + + /* Create the request completion event */ + Thread->RequestCompletionEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + + if ( ! Thread->RequestCompletionEvent ) + { + CloseHandle(Thread->RequestEvent); + return MMSYSERR_NOMEM; + } + + /* Create the kill event */ + Thread->KillEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + + if ( ! Thread->KillEvent ) + { + CloseHandle(Thread->RequestCompletionEvent); + CloseHandle(Thread->RequestEvent); + return MMSYSERR_NOMEM; + } + + return MMSYSERR_NOERROR; +} + +MMRESULT +DestroyThreadEvents( + IN PSOUND_THREAD Thread) +{ + CloseHandle(Thread->RequestEvent); + CloseHandle(Thread->RequestCompletionEvent); + CloseHandle(Thread->KillEvent); + + return MMSYSERR_NOERROR; +} + + +MMRESULT +StartSoundThread( + IN PSOUND_DEVICE_INSTANCE Instance) +{ + PSOUND_THREAD SoundThread = NULL; + + /* Validate parameters */ + if ( ! Instance ) + return MMSYSERR_INVALPARAM; + + /* Only allowed one thread per instance */ + if ( Instance->Thread ) + return MMSYSERR_ERROR; + + /* Allocate memory for the thread info */ + SoundThread = (PSOUND_THREAD) HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SOUND_THREAD)); + + if ( ! SoundThread ) + return MMSYSERR_NOMEM; + + /* Initialise */ + SoundThread->Running = FALSE; + SoundThread->Handle = INVALID_HANDLE_VALUE; + SoundThread->FirstOperation = NULL; + + /* Create the events */ + if ( CreateThreadEvents(SoundThread) != MMSYSERR_NOERROR ) + { + HeapFree(GetProcessHeap(), 0, SoundThread); + return MMSYSERR_NOMEM; + } + + if ( ! SoundThread->RequestEvent ) + { + CloseHandle(SoundThread->RequestEvent); + HeapFree(GetProcessHeap(), 0, SoundThread); + return MMSYSERR_NOMEM; + } + + /* Do the creation thang */ + SoundThread->Handle = CreateThread(NULL, + 0, + &SoundThreadProc, + (LPVOID) Instance, + CREATE_SUSPENDED, + NULL); + + if (SoundThread->Handle == INVALID_HANDLE_VALUE ) + { + HeapFree(GetProcessHeap(), 0, SoundThread); + return Win32ErrorToMmResult(GetLastError()); + } + + /* Assign the thread to the instance */ + Instance->Thread = SoundThread; + + /* Go! */ + ResumeThread(SoundThread->Handle); + + return MMSYSERR_NOERROR; +} + +MMRESULT +StopSoundThread( + IN PSOUND_DEVICE_INSTANCE Instance) +{ + if ( ! Instance ) + return MMSYSERR_INVALPARAM; + + if ( ! Instance->Thread ) + return MMSYSERR_ERROR; + + /* Make the thread quit */ + Instance->Thread->Running = FALSE; + + /* Wait for the thread to respond to our gentle nudge */ + SetEvent(Instance->Thread->KillEvent); + WaitForSingleObject(Instance->Thread, INFINITE); + CloseHandle(Instance->Thread); /* correct way? */ + + /* TODO: A bunch of other stuff - WAIT for thread to die */ + /* Also clean up the events */ + + DestroyThreadEvents(Instance->Thread); + HeapFree(GetProcessHeap(), 0, Instance->Thread); + + return MMSYSERR_NOERROR; +} + + +/* + Thread must be started before calling this! +*/ + +MMRESULT +AddSoundThreadOperation( + PSOUND_DEVICE_INSTANCE Instance, + DWORD OperationId, + SOUND_THREAD_OPERATION OperationFunc) +{ + /*SOUND_THREAD_OPERATION OriginalFirstOp;*/ + + if ( ! Instance ) + return MMSYSERR_INVALPARAM; + + if ( ! OperationFunc ) + return MMSYSERR_INVALPARAM; + + if ( ! Instance->Thread ) + return MMSYSERR_ERROR; + +/* + OriginalFirstOp = Instance->Thread->FirstOperation; + Instance->Thread->FirstOperation->Next = +*/ + + return MMSYSERR_NOTSUPPORTED; +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,63 @@ +/* + ReactOS Sound System + MME Driver Helper + + Purpose: + Utility functions + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> + +ULONG +GetDigitCount( + ULONG Number) +{ + ULONG Value = Number; + ULONG Digits = 1; + + while ( Value > 9 ) + { + Value /= 10; + ++ Digits; + } + + return Digits; +} + +MMRESULT +Win32ErrorToMmResult(UINT error_code) +{ + switch ( error_code ) + { + case NO_ERROR : + case ERROR_IO_PENDING : + return MMSYSERR_NOERROR; + + case ERROR_BUSY : + return MMSYSERR_ALLOCATED; + + case ERROR_NOT_SUPPORTED : + case ERROR_INVALID_FUNCTION : + return MMSYSERR_NOTSUPPORTED; + + case ERROR_NOT_ENOUGH_MEMORY : + return MMSYSERR_NOMEM; + + case ERROR_ACCESS_DENIED : + return MMSYSERR_BADDEVICEID; + + case ERROR_INSUFFICIENT_BUFFER : + return MMSYSERR_INVALPARAM; + }; + + /* If all else fails, it's just a plain old error */ + + return MMSYSERR_ERROR; +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c (added) +++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -1,0 +1,38 @@ +/* + ReactOS Sound System + MME Driver Helper + + Purpose: + Wave thread operations + + Author: + Andrew Greenwood (silverblade(a)reactos.org) + + History: + 4 July 2008 - Created +*/ + +#include <windows.h> +#include <mmsystem.h> + +#include <mmebuddy.h> + +MMRESULT +StartWaveThread( + IN PSOUND_DEVICE_INSTANCE Instance) +{ + MMRESULT Result; + + if ( ! Instance ) + return MMSYSERR_INVALPARAM; + + /* Kick off the thread */ + Result = StartSoundThread(Instance); + if ( Result != MMSYSERR_NOERROR ) + { + return Result; + } + + /* AddSoundThreadOperation(Instance, 69, SayHello); */ + return MMSYSERR_NOTSUPPORTED; +} Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/silverblade-audio/lib/drivers/sound/sound.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
============================================================================== --- branches/silverblade-audio/lib/drivers/sound/sound.rbuild [iso-8859-1] (original) +++ branches/silverblade-audio/lib/drivers/sound/sound.rbuild [iso-8859-1] Fri Jul 4 21:43:17 2008 @@ -13,4 +13,7 @@ <directory name="uartmidi"> <xi:include href="uartmidi/uartmidi.rbuild" /> </directory> + <directory name="mmebuddy"> + <xi:include href="mmebuddy/mmebuddy.rbuild" /> + </directory> </group>
16 years, 5 months
1
0
0
0
[cfinck] 34298: Convert the dnsapi stuff to a consistent 4 spaces indentation
by cfinck@svn.reactos.org
Author: cfinck Date: Fri Jul 4 17:41:28 2008 New Revision: 34298 URL:
http://svn.reactos.org/svn/reactos?rev=34298&view=rev
Log: Convert the dnsapi stuff to a consistent 4 spaces indentation Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/adns.c trunk/reactos/dll/win32/dnsapi/dnsapi/context.c trunk/reactos/dll/win32/dnsapi/dnsapi/free.c trunk/reactos/dll/win32/dnsapi/dnsapi/names.c trunk/reactos/dll/win32/dnsapi/dnsapi/query.c trunk/reactos/dll/win32/dnsapi/dnsapi/stubs.c trunk/reactos/dll/win32/dnsapi/include/internal/windns.h Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/adns.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/dnsapi/ad…
============================================================================== --- trunk/reactos/dll/win32/dnsapi/dnsapi/adns.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dnsapi/dnsapi/adns.c [iso-8859-1] Fri Jul 4 17:41:28 2008 @@ -13,14 +13,17 @@ #define NDEBUG #include <debug.h> -DNS_STATUS DnsIntTranslateAdnsToDNS_STATUS( int Status ) { - switch( Status ) { - case adns_s_ok: - return ERROR_SUCCESS; - case adns_s_nomemory: - case adns_s_systemfail: - default: /* There really aren't any general errors in the dns part. */ - return ERROR_OUTOFMEMORY; - } +DNS_STATUS +DnsIntTranslateAdnsToDNS_STATUS(int Status) +{ + switch(Status) + { + case adns_s_ok: + return ERROR_SUCCESS; + + case adns_s_nomemory: + case adns_s_systemfail: + default: /* There really aren't any general errors in the dns part. */ + return ERROR_OUTOFMEMORY; + } } - Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/dnsapi/co…
============================================================================== --- trunk/reactos/dll/win32/dnsapi/dnsapi/context.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dnsapi/dnsapi/context.c [iso-8859-1] Fri Jul 4 17:41:28 2008 @@ -30,96 +30,95 @@ * TODO: Which ones area allowed? */ -extern DNS_STATUS WINAPI DnsAcquireContextHandle_UTF8 -( DWORD CredentialsFlags, - PVOID Credentials, - HANDLE *ContextHandle ); +extern DNS_STATUS WINAPI DnsAcquireContextHandle_UTF8(DWORD CredentialsFlags, PVOID Credentials, HANDLE *ContextHandle); -DNS_STATUS WINAPI DnsAcquireContextHandle_W -( DWORD CredentialsFlags, - PVOID Credentials, - HANDLE *ContextHandle ) { - if( CredentialsFlags ) { - PWINDNS_CONTEXT Context; - int adns_status; +DNS_STATUS WINAPI +DnsAcquireContextHandle_W(DWORD CredentialsFlags, + PVOID Credentials, + HANDLE *ContextHandle) +{ + if(CredentialsFlags) + { + PWINDNS_CONTEXT Context; + int adns_status; - /* For now, don't worry about the user's identity. */ - Context = (PWINDNS_CONTEXT)RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof( WINDNS_CONTEXT ) ); + /* For now, don't worry about the user's identity. */ + Context = (PWINDNS_CONTEXT)RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(WINDNS_CONTEXT)); - if(!Context){ - *ContextHandle = 0; - return ERROR_OUTOFMEMORY; + if(!Context) + { + *ContextHandle = 0; + return ERROR_OUTOFMEMORY; + } + + /* The real work here is to create an adns_state that will help us + * do what we want to later. */ + adns_status = adns_init(&Context->State, adns_if_noenv | adns_if_noerrprint | adns_if_noserverwarn, 0); + + if(adns_status != adns_s_ok) + { + *ContextHandle = 0; + RtlFreeHeap(RtlGetProcessHeap(), 0, Context); + return DnsIntTranslateAdnsToDNS_STATUS(adns_status); + } + else + { + *ContextHandle = (HANDLE)Context; + return ERROR_SUCCESS; + } } - - /* The real work here is to create an adns_state that will help us - * do what we want to later. */ - adns_status = adns_init( &Context->State, - adns_if_noenv | - adns_if_noerrprint | - adns_if_noserverwarn, - 0 ); - if( adns_status != adns_s_ok ) { - *ContextHandle = 0; - RtlFreeHeap( RtlGetProcessHeap(), 0, Context ); - return DnsIntTranslateAdnsToDNS_STATUS( adns_status ); - } else { - *ContextHandle = (HANDLE)Context; - return ERROR_SUCCESS; + else + { + return DnsAcquireContextHandle_UTF8(CredentialsFlags, Credentials, ContextHandle); } - } else { - return DnsAcquireContextHandle_UTF8( CredentialsFlags, - Credentials, - ContextHandle ); - } } -DNS_STATUS WINAPI DnsAcquireContextHandle_UTF8 -( DWORD CredentialsFlags, - PVOID Credentials, - HANDLE *ContextHandle ) { - if( CredentialsFlags ) { - return DnsAcquireContextHandle_W( CredentialsFlags, - Credentials, - ContextHandle ); - } else { - /* Convert to unicode, then call the _W version - * For now, there is no conversion */ - DNS_STATUS Status; +DNS_STATUS WINAPI +DnsAcquireContextHandle_UTF8(DWORD CredentialsFlags, + PVOID Credentials, + HANDLE *ContextHandle) +{ + if( CredentialsFlags ) + { + return DnsAcquireContextHandle_W(CredentialsFlags, Credentials, ContextHandle); + } + else + { + /* Convert to unicode, then call the _W version + * For now, there is no conversion */ + DNS_STATUS Status; - Status = DnsAcquireContextHandle_W( TRUE, - Credentials, /* XXX arty */ - ContextHandle ); + Status = DnsAcquireContextHandle_W(TRUE, Credentials, /* XXX arty */ ContextHandle); - /* Free the unicode credentials when they exist. */ + /* Free the unicode credentials when they exist. */ - return Status; - } + return Status; + } } -DNS_STATUS WINAPI DnsAcquireContextHandle_A -( DWORD CredentialFlags, - PVOID Credentials, - HANDLE *ContextHandle ) { - if( CredentialFlags ) { - return DnsAcquireContextHandle_W( CredentialFlags, - Credentials, - ContextHandle ); - } else { - return DnsAcquireContextHandle_UTF8( CredentialFlags, - Credentials, - ContextHandle ); - } +DNS_STATUS WINAPI +DnsAcquireContextHandle_A(DWORD CredentialFlags, + PVOID Credentials, + HANDLE *ContextHandle) +{ + if(CredentialFlags) + { + return DnsAcquireContextHandle_W(CredentialFlags, Credentials, ContextHandle); + } + else + { + return DnsAcquireContextHandle_UTF8(CredentialFlags, Credentials, ContextHandle); + } } + /* DnsReleaseContextHandle ************* * Release a context handle, freeing all resources. */ +void WINAPI +DnsReleaseContextHandle(HANDLE ContextHandle) +{ + PWINDNS_CONTEXT Context = (PWINDNS_CONTEXT)ContextHandle; -void WINAPI DnsReleaseContextHandle -( HANDLE ContextHandle ) { - PWINDNS_CONTEXT Context = (PWINDNS_CONTEXT)ContextHandle; - adns_finish( Context->State ); - RtlFreeHeap( RtlGetProcessHeap(), 0, Context ); + adns_finish(Context->State); + RtlFreeHeap(RtlGetProcessHeap(), 0, Context); } - - Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/free.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/dnsapi/fr…
============================================================================== --- trunk/reactos/dll/win32/dnsapi/dnsapi/free.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dnsapi/dnsapi/free.c [iso-8859-1] Fri Jul 4 17:41:28 2008 @@ -13,24 +13,29 @@ #define NDEBUG #include <debug.h> -VOID WINAPI DnsFree -( PVOID Data, DNS_FREE_TYPE FreeType ) { - switch( FreeType ) { - case DnsFreeFlat: - RtlFreeHeap( RtlGetProcessHeap(), 0, Data ); - break; +VOID WINAPI +DnsFree(PVOID Data, + DNS_FREE_TYPE FreeType) +{ + switch(FreeType) + { + case DnsFreeFlat: + RtlFreeHeap( RtlGetProcessHeap(), 0, Data ); + break; - case DnsFreeRecordList: - DnsIntFreeRecordList( (PDNS_RECORD)Data ); - break; + case DnsFreeRecordList: + DnsIntFreeRecordList( (PDNS_RECORD)Data ); + break; - case DnsFreeParsedMessageFields: - /* assert( FALSE ); XXX arty not yet implemented. */ - break; - } + case DnsFreeParsedMessageFields: + /* assert( FALSE ); XXX arty not yet implemented. */ + break; + } } -VOID WINAPI DnsRecordListFree -( PDNS_RECORD Data, DNS_FREE_TYPE FreeType ) { - DnsFree( Data, FreeType ); +VOID WINAPI +DnsRecordListFree(PDNS_RECORD Data, + DNS_FREE_TYPE FreeType) +{ + DnsFree(Data, FreeType); } Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/names.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/dnsapi/na…
============================================================================== --- trunk/reactos/dll/win32/dnsapi/dnsapi/names.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dnsapi/dnsapi/names.c [iso-8859-1] Fri Jul 4 17:41:28 2008 @@ -3,16 +3,22 @@ #define NDEBUG #include <debug.h> -static BOOL DnsIntNameContainsDots( LPCWSTR Name ) { - return wcschr( Name, '.' ) ? TRUE : FALSE; -} - -static BOOL DnsIntTwoConsecutiveDots( LPCWSTR Name ) { - return wcsstr( Name, L".." ) ? TRUE : FALSE; -} - -static BOOL DnsIntContainsUnderscore( LPCWSTR Name ) { - return wcschr( Name, '_' ) ? TRUE : FALSE; +static BOOL +DnsIntNameContainsDots(LPCWSTR Name) +{ + return wcschr(Name, '.') ? TRUE : FALSE; +} + +static BOOL +DnsIntTwoConsecutiveDots(LPCWSTR Name) +{ + return wcsstr(Name, L"..") ? TRUE : FALSE; +} + +static BOOL +DnsIntContainsUnderscore(LPCWSTR Name) +{ + return wcschr(Name, '_') ? TRUE : FALSE; } /* DnsValidateName ********************* @@ -47,113 +53,126 @@ * If the name contains a non-ascii character. */ -DNS_STATUS WINAPI DnsValidateName_W -( LPCWSTR Name, - DNS_NAME_FORMAT Format ) { - BOOL AllowDot = FALSE; - BOOL AllowLeadingAst = FALSE; - BOOL AllowLeadingUnderscore = FALSE; - BOOL AllowAllDigits = FALSE; - const WCHAR *NextLabel, *CurrentLabel, *CurrentChar; - - switch( Format ) { - case DnsNameDomain: - AllowAllDigits = TRUE; - AllowDot = TRUE; - break; - case DnsNameDomainLabel: - AllowAllDigits = TRUE; - break; - case DnsNameHostnameFull: - AllowDot = TRUE; - break; - case DnsNameHostnameLabel: - break; - case DnsNameWildcard: - AllowLeadingAst = TRUE; - AllowDot = TRUE; - break; - case DnsNameSrvRecord: - AllowLeadingUnderscore = TRUE; - break; - default: - break; - } - - /* Preliminary checks */ - if( Name[0] == 0 ) return ERROR_INVALID_NAME; /* XXX arty: Check this */ - - /* Name too long */ - if( wcslen( Name ) > 255 ) { - return ERROR_INVALID_NAME; - } - - /* Violations about dots */ - if( (!AllowDot && DnsIntNameContainsDots( Name )) || - Name[0] == '.' || DnsIntTwoConsecutiveDots( Name ) ) - return ERROR_INVALID_NAME; - - /* Check component sizes */ - CurrentLabel = Name; - do { - NextLabel = CurrentLabel; - while( *NextLabel && *NextLabel != '.' ) NextLabel++; - - if( NextLabel - CurrentLabel > 63 ) - return ERROR_INVALID_NAME; - - CurrentLabel = NextLabel; - } while( *CurrentLabel ); - - CurrentChar = Name; - - while( *CurrentChar ) { - if( wcschr(L" {|}~[\\]^':;<=>?@!\"#$%^`()+/,",*CurrentChar) ) - return DNS_ERROR_INVALID_NAME_CHAR; - CurrentChar++; - } - - if( (!AllowLeadingAst && Name[0] == '*') || - (AllowLeadingAst && Name[0] == '*' && Name[1] && Name[1] != '.') ) - return DNS_ERROR_INVALID_NAME_CHAR; - - if( wcschr( Name + 1, '*' ) ) - return DNS_ERROR_INVALID_NAME_CHAR; - - CurrentChar = Name; - while( !AllowAllDigits && *CurrentChar ) { - if( *CurrentChar == '.' || (*CurrentChar >= '0' && *CurrentChar <= '9') ) - return DNS_ERROR_NUMERIC_NAME; - } - - if( ((AllowLeadingUnderscore && Name[0] == '_') || Name[0] != '_') && - !DnsIntContainsUnderscore( Name + 1 ) ) - return DNS_ERROR_NON_RFC_NAME; - - return ERROR_SUCCESS; -} - -DNS_STATUS WINAPI DnsValidateName_UTF8 -( LPCSTR Name, - DNS_NAME_FORMAT Format ) { - PWCHAR Buffer; - int StrLenWc; - DNS_STATUS Status; - - StrLenWc = mbstowcs( NULL, Name, 0 ); - Buffer = RtlAllocateHeap( GetProcessHeap(), 0, - sizeof( WCHAR ) * (StrLenWc + 1) ); - mbstowcs( Buffer, Name, StrLenWc + 1 ); - Status = DnsValidateName_W( Buffer, Format ); - RtlFreeHeap( RtlGetProcessHeap(), 0, Buffer ); - - return Status; -} - -DNS_STATUS WINAPI DnsValidateName_A -( LPCSTR Name, - DNS_NAME_FORMAT Format ) { - return DnsValidateName_UTF8( Name, Format ); +DNS_STATUS WINAPI +DnsValidateName_W(LPCWSTR Name, + DNS_NAME_FORMAT Format) +{ + BOOL AllowDot = FALSE; + BOOL AllowLeadingAst = FALSE; + BOOL AllowLeadingUnderscore = FALSE; + BOOL AllowAllDigits = FALSE; + const WCHAR *NextLabel, *CurrentLabel, *CurrentChar; + + switch(Format) + { + case DnsNameDomain: + AllowAllDigits = TRUE; + AllowDot = TRUE; + break; + + case DnsNameDomainLabel: + AllowAllDigits = TRUE; + break; + + case DnsNameHostnameFull: + AllowDot = TRUE; + break; + + case DnsNameHostnameLabel: + break; + + case DnsNameWildcard: + AllowLeadingAst = TRUE; + AllowDot = TRUE; + break; + + case DnsNameSrvRecord: + AllowLeadingUnderscore = TRUE; + break; + + default: + break; + } + + /* Preliminary checks */ + if(Name[0] == 0) + return ERROR_INVALID_NAME; /* XXX arty: Check this */ + + /* Name too long */ + if(wcslen(Name) > 255) + return ERROR_INVALID_NAME; + + /* Violations about dots */ + if((!AllowDot && DnsIntNameContainsDots(Name)) || Name[0] == '.' || DnsIntTwoConsecutiveDots(Name)) + return ERROR_INVALID_NAME; + + /* Check component sizes */ + CurrentLabel = Name; + + do + { + NextLabel = CurrentLabel; + while(*NextLabel && *NextLabel != '.') + NextLabel++; + + if(NextLabel - CurrentLabel > 63) + return ERROR_INVALID_NAME; + + CurrentLabel = NextLabel; + } while(*CurrentLabel); + + CurrentChar = Name; + + while(*CurrentChar) + { + if(wcschr(L" {|}~[\\]^':;<=>?@!\"#$%^`()+/,",*CurrentChar)) + return DNS_ERROR_INVALID_NAME_CHAR; + + CurrentChar++; + } + + if((!AllowLeadingAst && Name[0] == '*') || (AllowLeadingAst && Name[0] == '*' && Name[1] && Name[1] != '.')) + return DNS_ERROR_INVALID_NAME_CHAR; + + if(wcschr(Name + 1, '*')) + return DNS_ERROR_INVALID_NAME_CHAR; + + CurrentChar = Name; + + while(!AllowAllDigits && *CurrentChar) + { + if(*CurrentChar == '.' || (*CurrentChar >= '0' && *CurrentChar <= '9')) + return DNS_ERROR_NUMERIC_NAME; + } + + if(((AllowLeadingUnderscore && Name[0] == '_') || Name[0] != '_') && !DnsIntContainsUnderscore(Name + 1)) + return DNS_ERROR_NON_RFC_NAME; + + return ERROR_SUCCESS; +} + +DNS_STATUS WINAPI +DnsValidateName_UTF8(LPCSTR Name, + DNS_NAME_FORMAT Format) +{ + PWCHAR Buffer; + int StrLenWc; + DNS_STATUS Status; + + StrLenWc = mbstowcs(NULL, Name, 0); + Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(WCHAR) * (StrLenWc + 1)); + mbstowcs(Buffer, Name, StrLenWc + 1); + Status = DnsValidateName_W(Buffer, Format); + RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); + + return Status; +} + +DNS_STATUS WINAPI +DnsValidateName_A(LPCSTR Name, + DNS_NAME_FORMAT Format) +{ + return DnsValidateName_UTF8(Name, Format); } /* DnsNameCompare ********************** @@ -161,36 +180,39 @@ * * Name1 & Name2 -- Names. */ - -BOOL WINAPI DnsNameCompare_W -( LPWSTR Name1, - LPWSTR Name2 ) { - int offset = 0; - - while( Name1[offset] && Name2[offset] && - towupper( Name1[offset] ) == towupper( Name2[offset] ) ) offset++; - return - (!Name1[offset] && !Name2[offset]) || - (!Name1[offset] && !wcscmp( Name2 + offset, L"." )) || - (!Name2[offset] && !wcscmp( Name1 + offset, L"." )); -} - -BOOL WINAPI DnsNameCompare_UTF8 -( LPCSTR Name1, - LPCSTR Name2 ) { - int offset = 0; - - while( Name1[offset] && Name2[offset] && - toupper( Name1[offset] ) == toupper( Name2[offset] ) ) offset++; - return - (!Name1[offset] && !Name2[offset]) || - (!Name1[offset] && !strcmp( Name2 + offset, ".")) || - (!Name2[offset] && !strcmp( Name1 + offset, ".")); -} - -BOOL WINAPI DnsNameCompare_A -( LPSTR Name1, - LPSTR Name2 ) { - return DnsNameCompare_UTF8( Name1, Name2 ); -} - +BOOL WINAPI +DnsNameCompare_W(LPWSTR Name1, + LPWSTR Name2) +{ + int offset = 0; + + while(Name1[offset] && Name2[offset] && towupper(Name1[offset]) == towupper(Name2[offset])) + offset++; + + return + (!Name1[offset] && !Name2[offset]) || + (!Name1[offset] && !wcscmp(Name2 + offset, L".")) || + (!Name2[offset] && !wcscmp(Name1 + offset, L".")); +} + +BOOL WINAPI +DnsNameCompare_UTF8(LPCSTR Name1, + LPCSTR Name2) +{ + int offset = 0; + + while(Name1[offset] && Name2[offset] && toupper(Name1[offset]) == toupper(Name2[offset])) + offset++; + + return + (!Name1[offset] && !Name2[offset]) || + (!Name1[offset] && !strcmp(Name2 + offset, ".")) || + (!Name2[offset] && !strcmp(Name1 + offset, ".")); +} + +BOOL WINAPI +DnsNameCompare_A(LPSTR Name1, + LPSTR Name2) +{ + return DnsNameCompare_UTF8(Name1, Name2); +} Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/dnsapi/qu…
============================================================================== --- trunk/reactos/dll/win32/dnsapi/dnsapi/query.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dnsapi/dnsapi/query.c [iso-8859-1] Fri Jul 4 17:41:28 2008 @@ -31,312 +31,317 @@ * Reserved -- Response as it appears on the wire. Optional. */ -char *xstrsave(const char *str) { - char *p; - - p = RtlAllocateHeap( RtlGetProcessHeap(), 0, strlen(str)+1 ); - if ( NULL != p ) { - strcpy(p,str); - } - return p; -} - -DNS_STATUS WINAPI DnsQuery_A -( LPCSTR Name, - WORD Type, - DWORD Options, - PIP4_ARRAY Servers, - PDNS_RECORD *QueryResultSet, - PVOID *Reserved ) { - adns_state astate; - int quflags = 0, i; - int adns_error; - adns_answer *answer; - LPSTR CurrentName; - unsigned CNameLoop; - - *QueryResultSet = 0; - - switch( Type ) { - case DNS_TYPE_A: - adns_error = adns_init( &astate, - adns_if_noenv | - adns_if_noerrprint | - adns_if_noserverwarn | - (Servers ? adns_if_noserver : 0), - 0 ); - - if( adns_error != adns_s_ok ) { - return DnsIntTranslateAdnsToDNS_STATUS( adns_error ); +char +*xstrsave(const char *str) +{ + char *p; + + p = RtlAllocateHeap(RtlGetProcessHeap(), 0, strlen(str) + 1); + + if(p) + strcpy(p, str); + + return p; +} + +DNS_STATUS WINAPI +DnsQuery_A(LPCSTR Name, + WORD Type, + DWORD Options, + PIP4_ARRAY Servers, + PDNS_RECORD *QueryResultSet, + PVOID *Reserved) +{ + adns_state astate; + int quflags = 0, i; + int adns_error; + adns_answer *answer; + LPSTR CurrentName; + unsigned CNameLoop; + + *QueryResultSet = 0; + + switch(Type) + { + case DNS_TYPE_A: + adns_error = adns_init(&astate, adns_if_noenv | adns_if_noerrprint | adns_if_noserverwarn | (Servers ? adns_if_noserver : 0), 0); + + if(adns_error != adns_s_ok) + return DnsIntTranslateAdnsToDNS_STATUS(adns_error); + + if (Servers) + { + for(i = 0; i < Servers->AddrCount; i++) + { + adns_addserver(astate, *((struct in_addr *)&Servers->AddrArray[i])); + } + } + + /* + * adns doesn't resolve chained CNAME records (a CNAME which points to + * another CNAME pointing to another... pointing to an A record), according + * to a mailing list thread the authors believe that chained CNAME records + * are invalid and the DNS entries should be fixed. That's a nice academic + * standpoint, but there certainly are chained CNAME records out there, + * even some fairly major ones (at the time of this writing + *
download.mozilla.org
is a chained CNAME). Everyone else seems to resolve + * these fine, so we should too. So we loop here to try to resolve CNAME + * chains ourselves. Of course, there must be a limit to protect against + * CNAME loops. + */ + +#define CNAME_LOOP_MAX 16 + + CurrentName = (LPSTR) Name; + + for (CNameLoop = 0; CNameLoop < CNAME_LOOP_MAX; CNameLoop++) + { + adns_error = adns_synchronous(astate, CurrentName, adns_r_addr, quflags, &answer); + + if(adns_error != adns_s_ok) + { + adns_finish(astate); + + if (CurrentName != Name) + RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentName); + + return DnsIntTranslateAdnsToDNS_STATUS(adns_error); + } + + if(answer && answer->rrs.addr) + { + if (CurrentName != Name) + RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentName); + + *QueryResultSet = (PDNS_RECORD)RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); + + if (NULL == *QueryResultSet) + { + adns_finish( astate ); + return ERROR_OUTOFMEMORY; + } + + (*QueryResultSet)->pNext = NULL; + (*QueryResultSet)->wType = Type; + (*QueryResultSet)->wDataLength = sizeof(DNS_A_DATA); + (*QueryResultSet)->Data.A.IpAddress = answer->rrs.addr->addr.inet.sin_addr.s_addr; + + adns_finish(astate); + + (*QueryResultSet)->pName = xstrsave( Name ); + + return NULL != (*QueryResultSet)->pName ? ERROR_SUCCESS : ERROR_OUTOFMEMORY; + } + + if (NULL == answer || adns_s_prohibitedcname != answer->status || NULL == answer->cname) + { + adns_finish(astate); + + if (CurrentName != Name) + RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentName); + + return ERROR_FILE_NOT_FOUND; + } + + if (CurrentName != Name) + RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentName); + + CurrentName = xstrsave(answer->cname); + + if (!CurrentName) + { + adns_finish(astate); + return ERROR_OUTOFMEMORY; + } + } + + adns_finish(astate); + RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentName); + return ERROR_FILE_NOT_FOUND; + + default: + return ERROR_OUTOFMEMORY; /* XXX arty: find a better error code. */ } - - if (Servers) { - for( i = 0; i < Servers->AddrCount; i++ ) { - adns_addserver( astate, *((struct in_addr *)&Servers->AddrArray[i]) ); - } +} + +static PCHAR +DnsWToC(const WCHAR *WideString) +{ + int chars = wcstombs(NULL, WideString, 0); + PCHAR out = RtlAllocateHeap(RtlGetProcessHeap(), 0, chars + 1); + + wcstombs(out, WideString, chars + 1); + + return out; +} + +static PWCHAR +DnsCToW(const CHAR *NarrowString) +{ + int chars = mbstowcs(NULL, NarrowString, 0); + PWCHAR out = RtlAllocateHeap(RtlGetProcessHeap(), 0, (chars + 1) * sizeof(WCHAR)); + + mbstowcs(out, NarrowString, chars + 1); + + return out; +} + +DNS_STATUS WINAPI +DnsQuery_W(LPCWSTR Name, + WORD Type, + DWORD Options, + PIP4_ARRAY Servers, + PDNS_RECORD *QueryResultSet, + PVOID *Reserved) +{ + UINT i; + PCHAR Buffer; + DNS_STATUS Status; + PDNS_RECORD QueryResultWide; + PDNS_RECORD ConvertedRecord = 0, LastRecord = 0; + + Buffer = DnsWToC(Name); + + Status = DnsQuery_A(Buffer, Type, Options, Servers, &QueryResultWide, Reserved); + + while(Status == ERROR_SUCCESS && QueryResultWide) + { + switch(QueryResultWide->wType) + { + case DNS_TYPE_A: + case DNS_TYPE_WKS: + ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); + ConvertedRecord->pName = (PCHAR)DnsCToW(QueryResultWide->pName); + ConvertedRecord->wType = QueryResultWide->wType; + ConvertedRecord->wDataLength = QueryResultWide->wDataLength; + memcpy(ConvertedRecord, QueryResultWide, QueryResultWide->wDataLength); + break; + + case DNS_TYPE_CNAME: + case DNS_TYPE_PTR: + case DNS_TYPE_NS: + case DNS_TYPE_MB: + case DNS_TYPE_MD: + case DNS_TYPE_MF: + case DNS_TYPE_MG: + case DNS_TYPE_MR: + ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); + ConvertedRecord->pName = (PCHAR)DnsCToW(QueryResultWide->pName); + ConvertedRecord->wType = QueryResultWide->wType; + ConvertedRecord->wDataLength = sizeof(DNS_PTR_DATA); + ConvertedRecord->Data.PTR.pNameHost = (PCHAR)DnsCToW(QueryResultWide->Data.PTR.pNameHost); + break; + + case DNS_TYPE_MINFO: + ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); + ConvertedRecord->pName = (PCHAR)DnsCToW(QueryResultWide->pName); + ConvertedRecord->wType = QueryResultWide->wType; + ConvertedRecord->wDataLength = sizeof(DNS_MINFO_DATA); + ConvertedRecord->Data.MINFO.pNameMailbox = (PCHAR)DnsCToW(QueryResultWide->Data.MINFO.pNameMailbox); + ConvertedRecord->Data.MINFO.pNameErrorsMailbox = (PCHAR)DnsCToW(QueryResultWide->Data.MINFO.pNameErrorsMailbox); + break; + + case DNS_TYPE_MX: + ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_RECORD)); + ConvertedRecord->pName = (PCHAR)DnsCToW(QueryResultWide->pName); + ConvertedRecord->wType = QueryResultWide->wType; + ConvertedRecord->wDataLength = sizeof(DNS_MX_DATA); + ConvertedRecord->Data.MX.pNameExchange = (PCHAR)DnsCToW( QueryResultWide->Data.MX.pNameExchange); + ConvertedRecord->Data.MX.wPreference = QueryResultWide->Data.MX.wPreference; + break; + + case DNS_TYPE_HINFO: + ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_TXT_DATA) + QueryResultWide->Data.TXT.dwStringCount); + ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); + ConvertedRecord->wType = QueryResultWide->wType; + ConvertedRecord->wDataLength = sizeof(DNS_TXT_DATA) + (sizeof(PWCHAR) * QueryResultWide->Data.TXT.dwStringCount); + ConvertedRecord->Data.TXT.dwStringCount = QueryResultWide->Data.TXT.dwStringCount; + + for(i = 0; i < ConvertedRecord->Data.TXT.dwStringCount; i++) + ConvertedRecord->Data.TXT.pStringArray[i] = (PCHAR)DnsCToW(QueryResultWide->Data.TXT.pStringArray[i]); + + break; + + case DNS_TYPE_NULL: + ConvertedRecord = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(DNS_NULL_DATA) + QueryResultWide->Data.Null.dwByteCount); + ConvertedRecord->pName = (PCHAR)DnsCToW(QueryResultWide->pName); + ConvertedRecord->wType = QueryResultWide->wType; + ConvertedRecord->wDataLength = sizeof(DNS_NULL_DATA) + QueryResultWide->Data.Null.dwByteCount; + ConvertedRecord->Data.Null.dwByteCount = QueryResultWide->Data.Null.dwByteCount; + memcpy(&ConvertedRecord->Data.Null.Data, &QueryResultWide->Data.Null.Data, QueryResultWide->Data.Null.dwByteCount); + break; + } + + if(LastRecord) + { + LastRecord->pNext = ConvertedRecord; + LastRecord = LastRecord->pNext; + } + else + { + LastRecord = *QueryResultSet = ConvertedRecord; + } } - /* - * adns doesn't resolve chained CNAME records (a CNAME which points to - * another CNAME pointing to another... pointing to an A record), according - * to a mailing list thread the authors believe that chained CNAME records - * are invalid and the DNS entries should be fixed. That's a nice academic - * standpoint, but there certainly are chained CNAME records out there, - * even some fairly major ones (at the time of this writing - *
download.mozilla.org
is a chained CNAME). Everyone else seems to resolve - * these fine, so we should too. So we loop here to try to resolve CNAME - * chains ourselves. Of course, there must be a limit to protect against - * CNAME loops. - */ - -#define CNAME_LOOP_MAX 16 - - CurrentName = (LPSTR) Name; - for ( CNameLoop = 0; CNameLoop < CNAME_LOOP_MAX; CNameLoop++ ) { - adns_error = adns_synchronous( astate, - CurrentName, - adns_r_addr, - quflags, - &answer ); - - if( adns_error != adns_s_ok ) { - adns_finish( astate ); - if ( CurrentName != Name ) { - RtlFreeHeap( RtlGetProcessHeap(), 0, CurrentName ); + LastRecord->pNext = 0; + + /* The name */ + RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); + + return Status; +} + +DNS_STATUS WINAPI +DnsQuery_UTF8(LPCSTR Name, + WORD Type, + DWORD Options, + PIP4_ARRAY Servers, + PDNS_RECORD *QueryResultSet, + PVOID *Reserved) +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +void +DnsIntFreeRecordList(PDNS_RECORD ToDelete) +{ + UINT i; + PDNS_RECORD next = 0; + + while(ToDelete) + { + if(ToDelete->pName) + RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->pName); + + switch(ToDelete->wType) + { + case DNS_TYPE_CNAME: + case DNS_TYPE_PTR: + case DNS_TYPE_NS: + case DNS_TYPE_MB: + case DNS_TYPE_MD: + case DNS_TYPE_MF: + case DNS_TYPE_MG: + case DNS_TYPE_MR: + RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->Data.PTR.pNameHost); + break; + + case DNS_TYPE_MINFO: + case DNS_TYPE_MX: + RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->Data.MX.pNameExchange); + break; + + case DNS_TYPE_HINFO: + for(i = 0; i < ToDelete->Data.TXT.dwStringCount; i++) + RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->Data.TXT.pStringArray[i]); + + RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->Data.TXT.pStringArray); + break; } - return DnsIntTranslateAdnsToDNS_STATUS( adns_error ); - } - - if( answer && answer->rrs.addr ) { - if ( CurrentName != Name ) { - RtlFreeHeap( RtlGetProcessHeap(), 0, CurrentName ); - } - *QueryResultSet = - (PDNS_RECORD)RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof( DNS_RECORD ) ); - if ( NULL == *QueryResultSet ) { - adns_finish( astate ); - return ERROR_OUTOFMEMORY; - } - (*QueryResultSet)->pNext = NULL; - (*QueryResultSet)->wType = Type; - (*QueryResultSet)->wDataLength = sizeof(DNS_A_DATA); - (*QueryResultSet)->Data.A.IpAddress = - answer->rrs.addr->addr.inet.sin_addr.s_addr; - adns_finish( astate ); - (*QueryResultSet)->pName = xstrsave( Name ); - return NULL != (*QueryResultSet)->pName ? ERROR_SUCCESS : - ERROR_OUTOFMEMORY; - } - if ( NULL == answer || adns_s_prohibitedcname != answer->status || - NULL == answer->cname ) { - adns_finish( astate ); - if ( CurrentName != Name ) { - RtlFreeHeap( RtlGetProcessHeap(), 0, CurrentName ); - } - return ERROR_FILE_NOT_FOUND; - } - if ( CurrentName != Name ) { - RtlFreeHeap( RtlGetProcessHeap(), 0, CurrentName ); - } - CurrentName = xstrsave( answer->cname ); - if ( NULL == CurrentName ) { - adns_finish( astate ); - return ERROR_OUTOFMEMORY; - } + + next = ToDelete->pNext; + RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete); + ToDelete = next; } - adns_finish( astate ); - RtlFreeHeap( RtlGetProcessHeap(), 0, CurrentName ); - return ERROR_FILE_NOT_FOUND; - default: - return ERROR_OUTOFMEMORY; /* XXX arty: find a better error code. */ - } -} - -static PCHAR DnsWToC( const WCHAR *WideString ) { - int chars = wcstombs( NULL, WideString, 0 ); - PCHAR out = RtlAllocateHeap( RtlGetProcessHeap(), 0, chars + 1 ); - wcstombs( out, WideString, chars + 1 ); - return out; -} - -static PWCHAR DnsCToW( const CHAR *NarrowString ) { - int chars = mbstowcs( NULL, NarrowString, 0 ); - PWCHAR out = RtlAllocateHeap( RtlGetProcessHeap(), 0, - (chars + 1) * sizeof(WCHAR) ); - mbstowcs( out, NarrowString, chars + 1 ); - return out; -} - -DNS_STATUS WINAPI DnsQuery_W -( LPCWSTR Name, - WORD Type, - DWORD Options, - PIP4_ARRAY Servers, - PDNS_RECORD *QueryResultSet, - PVOID *Reserved ) { - UINT i; - PCHAR Buffer; - DNS_STATUS Status; - PDNS_RECORD QueryResultWide; - PDNS_RECORD ConvertedRecord = 0, LastRecord = 0; - - Buffer = DnsWToC( Name ); - - Status = DnsQuery_A( Buffer, Type, Options, Servers, &QueryResultWide, - Reserved ); - - while( Status == ERROR_SUCCESS && QueryResultWide ) { - switch( QueryResultWide->wType ) { - case DNS_TYPE_A: - case DNS_TYPE_WKS: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof(DNS_RECORD) ); - ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); - ConvertedRecord->wType = QueryResultWide->wType; - ConvertedRecord->wDataLength = QueryResultWide->wDataLength; - memcpy( ConvertedRecord, QueryResultWide, - QueryResultWide->wDataLength ); - break; - - case DNS_TYPE_CNAME: - case DNS_TYPE_PTR: - case DNS_TYPE_NS: - case DNS_TYPE_MB: - case DNS_TYPE_MD: - case DNS_TYPE_MF: - case DNS_TYPE_MG: - case DNS_TYPE_MR: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof(DNS_RECORD) ); - ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); - ConvertedRecord->wType = QueryResultWide->wType; - ConvertedRecord->wDataLength = sizeof(DNS_PTR_DATA); - ConvertedRecord->Data.PTR.pNameHost = - (PCHAR)DnsCToW( QueryResultWide->Data.PTR.pNameHost ); - break; - case DNS_TYPE_MINFO: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof(DNS_RECORD) ); - ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); - ConvertedRecord->wType = QueryResultWide->wType; - ConvertedRecord->wDataLength = sizeof(DNS_MINFO_DATA); - ConvertedRecord->Data.MINFO.pNameMailbox = - (PCHAR)DnsCToW( QueryResultWide->Data.MINFO.pNameMailbox ); - ConvertedRecord->Data.MINFO.pNameErrorsMailbox = - (PCHAR)DnsCToW( QueryResultWide->Data.MINFO.pNameErrorsMailbox ); - break; - - case DNS_TYPE_MX: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof(DNS_RECORD) ); - ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); - ConvertedRecord->wType = QueryResultWide->wType; - ConvertedRecord->wDataLength = sizeof(DNS_MX_DATA); - ConvertedRecord->Data.MX.pNameExchange = - (PCHAR)DnsCToW( QueryResultWide->Data.MX.pNameExchange ); - ConvertedRecord->Data.MX.wPreference = - QueryResultWide->Data.MX.wPreference; - break; - - case DNS_TYPE_HINFO: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof(DNS_TXT_DATA) + - QueryResultWide-> - Data.TXT.dwStringCount ); - ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); - ConvertedRecord->wType = QueryResultWide->wType; - ConvertedRecord->wDataLength = - sizeof(DNS_TXT_DATA) + - (sizeof(PWCHAR) * QueryResultWide->Data.TXT.dwStringCount); - ConvertedRecord->Data.TXT.dwStringCount = - QueryResultWide->Data.TXT.dwStringCount; - for( i = 0; i < ConvertedRecord->Data.TXT.dwStringCount; i++ ) { - ConvertedRecord->Data.TXT.pStringArray[i] = - (PCHAR)DnsCToW( QueryResultWide->Data.TXT.pStringArray[i] ); - } - break; - - case DNS_TYPE_NULL: - ConvertedRecord = RtlAllocateHeap( RtlGetProcessHeap(), 0, - sizeof(DNS_NULL_DATA) + - QueryResultWide-> - Data.Null.dwByteCount ); - ConvertedRecord->pName = (PCHAR)DnsCToW( QueryResultWide->pName ); - ConvertedRecord->wType = QueryResultWide->wType; - ConvertedRecord->wDataLength = - sizeof(DNS_NULL_DATA) + QueryResultWide->Data.Null.dwByteCount; - ConvertedRecord->Data.Null.dwByteCount = - QueryResultWide->Data.Null.dwByteCount; - memcpy( &ConvertedRecord->Data.Null.Data, - &QueryResultWide->Data.Null.Data, - QueryResultWide->Data.Null.dwByteCount ); - break; - - } - - if( LastRecord ) { - LastRecord->pNext = ConvertedRecord; - LastRecord = LastRecord->pNext; - } else { - LastRecord = *QueryResultSet = ConvertedRecord; - } - } - - LastRecord->pNext = 0; - - /* The name */ - RtlFreeHeap( RtlGetProcessHeap(), 0, Buffer ); - - return Status; -} - -DNS_STATUS WINAPI DnsQuery_UTF8 -( LPCSTR Name, - WORD Type, - DWORD Options, - PIP4_ARRAY Servers, - PDNS_RECORD *QueryResultSet, - PVOID *Reserved ) { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -void DnsIntFreeRecordList( PDNS_RECORD ToDelete ) { - UINT i; - PDNS_RECORD next = 0; - - while( ToDelete ) { - if( ToDelete->pName ) - RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->pName ); - switch( ToDelete->wType ) { - case DNS_TYPE_CNAME: - case DNS_TYPE_PTR: - case DNS_TYPE_NS: - case DNS_TYPE_MB: - case DNS_TYPE_MD: - case DNS_TYPE_MF: - case DNS_TYPE_MG: - case DNS_TYPE_MR: - RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.PTR.pNameHost ); - break; - case DNS_TYPE_MINFO: - case DNS_TYPE_MX: - RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.MX.pNameExchange ); - break; - - case DNS_TYPE_HINFO: - for( i = 0; i < ToDelete->Data.TXT.dwStringCount; i++ ) { - RtlFreeHeap( RtlGetProcessHeap(), 0, - ToDelete->Data.TXT.pStringArray[i] ); - } - RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete->Data.TXT.pStringArray ); - break; - - } - - next = ToDelete->pNext; - RtlFreeHeap( RtlGetProcessHeap(), 0, ToDelete ); - ToDelete = next; - } -} +} Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/dnsapi/st…
============================================================================== --- trunk/reactos/dll/win32/dnsapi/dnsapi/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dnsapi/dnsapi/stubs.c [iso-8859-1] Fri Jul 4 17:41:28 2008 @@ -8,577 +8,807 @@ typedef ULONG DNS_STATUS; -DNS_STATUS WINAPI DnsAddRecordSet_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsAddRecordSet_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsAddRecordSet_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsAllocateRecord() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsApiHeapReset() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsAsyncRegisterHostAddrs_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsAsyncRegisterHostAddrs_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsAsyncRegisterHostAddrs_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsAsyncRegisterInit() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsAsyncRegisterTerm() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsCheckNameCollision_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsCheckNameCollision_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsCheckNameCollision_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsCopyStringEx() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsCreateReverseNameStringForIpAddress() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsCreateStandardDnsNameCopy() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsCreateStringCopy() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsDhcpSrvRegisterHostName_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsDhcpSrvRegisterInit() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsDhcpSrvRegisterTerm() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsDisableAdapterDomainNameRegistration() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsDisableBNodeResolverThread() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsDisableDynamicRegistration() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsDowncaseDnsNameLabel() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsEnableAdapterDomainNameRegistration() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsEnableBNodeResolverThread() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsEnableDynamicRegistration() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsExtractRecordsFromMessage_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsExtractRecordsFromMessage_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsFindAuthoritativeZone() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsFlushResolverCache() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsFlushResolverCacheEntry_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsFlushResolverCacheEntry_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsFlushResolverCacheEntry_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsFreeAdapterInformation() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsFreeNetworkInformation() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsFreeSearchInformation() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetBufferLengthForStringCopy() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetCacheDataTable() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetDnsServerList() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetDomainName() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetHostName_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetHostName_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetHostName_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetIpAddressInfoList() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetIpAddressList() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetLastServerUpdateIP() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetMaxNumberOfAddressesToRegister() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetNetworkInformation() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetPrimaryDomainName_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetPrimaryDomainName_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetPrimaryDomainName_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsGetSearchInformation() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsIpv6AddressToString() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsIpv6StringToAddress() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsIsAMailboxType() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsIsAdapterDomainNameRegistrationEnabled() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsIsDynamicRegistrationEnabled() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsIsStatusRcode() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsIsStringCountValidForTextType() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsMapRcodeToStatus() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsModifyRecordSet_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsModifyRecordSet_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsModifyRecordSet_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsModifyRecordsInSet_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsModifyRecordsInSet_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsModifyRecordsInSet_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsNameCompareEx_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsNameCompareEx_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsNameCompareEx_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsNameCopy() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsNameCopyAllocate() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsQueryConfig() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsQueryEx() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordBuild_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordBuild_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordCompare() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordCopyEx() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordSetCompare() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordSetCopyEx() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordSetDetach() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordStringForType() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordStringForWritableType() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRecordTypeForName() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRelationalCompare_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRelationalCompare_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsRemoveRegistrations() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsReplaceRecordSetA() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsReplaceRecordSetUTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsReplaceRecordSetW() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsReplaceRecordSet_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsReplaceRecordSet_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsReplaceRecordSet_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsServiceNotificationDeregister_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsServiceNotificationDeregister_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsServiceNotificationDeregister_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsServiceNotificationRegister_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsServiceNotificationRegister_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsServiceNotificationRegister_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsSetMaxNumberOfAddressesToRegister() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsStatusString() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsStringCopyAllocateEx() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsUnicodeToUtf8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsUpdate() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsUpdateTest_A() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsUpdateTest_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsUpdateTest_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsUtf8ToUnicode() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsValidateUtf8Byte() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsWinsRecordFlagForString() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsWinsRecordFlagString() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsWriteQuestionToBuffer_UTF8() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsWriteQuestionToBuffer_W() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI DnsWriteReverseNameStringForIpAddress() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} - -DNS_STATUS WINAPI GetCurrentTimeInSeconds() { - UNIMPLEMENTED; - return ERROR_OUTOFMEMORY; -} +DNS_STATUS WINAPI +DnsAddRecordSet_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsAddRecordSet_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsAddRecordSet_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsAllocateRecord() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsApiHeapReset() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsAsyncRegisterHostAddrs_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsAsyncRegisterHostAddrs_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsAsyncRegisterHostAddrs_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsAsyncRegisterInit() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsAsyncRegisterTerm() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsCheckNameCollision_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsCheckNameCollision_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsCheckNameCollision_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsCopyStringEx() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsCreateReverseNameStringForIpAddress() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsCreateStandardDnsNameCopy() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsCreateStringCopy() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsDhcpSrvRegisterHostName_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsDhcpSrvRegisterInit() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsDhcpSrvRegisterTerm() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsDisableAdapterDomainNameRegistration() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsDisableBNodeResolverThread() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsDisableDynamicRegistration() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsDowncaseDnsNameLabel() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsEnableAdapterDomainNameRegistration() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsEnableBNodeResolverThread() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsEnableDynamicRegistration() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsExtractRecordsFromMessage_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsExtractRecordsFromMessage_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsFindAuthoritativeZone() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsFlushResolverCache() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsFlushResolverCacheEntry_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsFlushResolverCacheEntry_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsFlushResolverCacheEntry_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsFreeAdapterInformation() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsFreeNetworkInformation() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsFreeSearchInformation() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetBufferLengthForStringCopy() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetCacheDataTable() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetDnsServerList() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetDomainName() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetHostName_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetHostName_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetHostName_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetIpAddressInfoList() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetIpAddressList() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetLastServerUpdateIP() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetMaxNumberOfAddressesToRegister() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetNetworkInformation() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetPrimaryDomainName_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetPrimaryDomainName_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetPrimaryDomainName_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsGetSearchInformation() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsIpv6AddressToString() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsIpv6StringToAddress() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsIsAMailboxType() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsIsAdapterDomainNameRegistrationEnabled() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsIsDynamicRegistrationEnabled() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsIsStatusRcode() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsIsStringCountValidForTextType() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsMapRcodeToStatus() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsModifyRecordSet_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsModifyRecordSet_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsModifyRecordSet_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsModifyRecordsInSet_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsModifyRecordsInSet_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsModifyRecordsInSet_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsNameCompareEx_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsNameCompareEx_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsNameCompareEx_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsNameCopy() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsNameCopyAllocate() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsQueryConfig() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsQueryEx() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordBuild_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordBuild_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordCompare() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordCopyEx() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordSetCompare() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordSetCopyEx() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordSetDetach() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordStringForType() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordStringForWritableType() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRecordTypeForName() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRelationalCompare_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRelationalCompare_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsRemoveRegistrations() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsReplaceRecordSetA() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsReplaceRecordSetUTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsReplaceRecordSetW() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsReplaceRecordSet_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsReplaceRecordSet_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsReplaceRecordSet_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsServiceNotificationDeregister_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsServiceNotificationDeregister_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsServiceNotificationDeregister_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsServiceNotificationRegister_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsServiceNotificationRegister_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsServiceNotificationRegister_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsSetMaxNumberOfAddressesToRegister() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsStatusString() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsStringCopyAllocateEx() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsUnicodeToUtf8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsUpdate() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsUpdateTest_A() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsUpdateTest_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsUpdateTest_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsUtf8ToUnicode() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsValidateUtf8Byte() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsWinsRecordFlagForString() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsWinsRecordFlagString() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsWriteQuestionToBuffer_UTF8() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsWriteQuestionToBuffer_W() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +DnsWriteReverseNameStringForIpAddress() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} + +DNS_STATUS WINAPI +GetCurrentTimeInSeconds() +{ + UNIMPLEMENTED; + return ERROR_OUTOFMEMORY; +} Modified: trunk/reactos/dll/win32/dnsapi/include/internal/windns.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/include/i…
============================================================================== --- trunk/reactos/dll/win32/dnsapi/include/internal/windns.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dnsapi/include/internal/windns.h [iso-8859-1] Fri Jul 4 17:41:28 2008 @@ -3,11 +3,12 @@ #include "adns.h" -typedef struct { - adns_state State; +typedef struct +{ + adns_state State; } WINDNS_CONTEXT, *PWINDNS_CONTEXT; -DNS_STATUS DnsIntTranslateAdnsToDNS_STATUS( int Status ); -void DnsIntFreeRecordList( PDNS_RECORD ToFree ); +DNS_STATUS DnsIntTranslateAdnsToDNS_STATUS(int Status); +void DnsIntFreeRecordList(PDNS_RECORD ToFree); #endif//WINDNS_INTERNAL_H
16 years, 5 months
1
0
0
0
[jimtabor] 34296: Add two more query window types.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Jul 4 13:52:22 2008 New Revision: 34296 URL:
http://svn.reactos.org/svn/reactos?rev=34296&view=rev
Log: Add two more query window types. Modified: trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/ntuser/window.c Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Fri Jul 4 13:52:22 2008 @@ -1903,6 +1903,8 @@ #define QUERY_WINDOW_UNIQUE_PROCESS_ID 0x00 #define QUERY_WINDOW_UNIQUE_THREAD_ID 0x01 +#define QUERY_WINDOW_ACTIVE 0x02 +#define QUERY_WINDOW_FOCUS 0x03 #define QUERY_WINDOW_ISHUNG 0x04 DWORD NTAPI Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Fri Jul 4 13:52:22 2008 @@ -3952,12 +3952,14 @@ 0 = QWUniqueProcessId 1 = QWUniqueThreadId + 2 = QWActiveWindow + 3 = QWFocusWindow 4 = QWIsHung Implements IsHungAppWindow found by KJK::Hyperion. - 9 = QWKillWindow When I called this with hWnd == - DesktopWindow, it shutdown the system - and rebooted. + 9 = QWKillWindow When I called this with hWnd == + DesktopWindow, it shutdown the system + and rebooted. */ /* * @implemented @@ -3985,6 +3987,14 @@ case QUERY_WINDOW_UNIQUE_THREAD_ID: Result = (DWORD)IntGetWndThreadId(Window); + break; + + case QUERY_WINDOW_ACTIVE: + Result = (DWORD)UserGetActiveWindow(); + break; + + case QUERY_WINDOW_FOCUS: + Result = (DWORD)IntGetFocusWindow(); break; case QUERY_WINDOW_ISHUNG:
16 years, 5 months
1
0
0
0
[janderwald] 34295: - fix typo
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Jul 4 13:10:59 2008 New Revision: 34295 URL:
http://svn.reactos.org/svn/reactos?rev=34295&view=rev
Log: - fix typo Modified: trunk/reactos/boot/bootdata/hivecls_arm.inf trunk/reactos/boot/bootdata/hivecls_i386.inf Modified: trunk/reactos/boot/bootdata/hivecls_arm.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls_arm.…
============================================================================== --- trunk/reactos/boot/bootdata/hivecls_arm.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivecls_arm.inf [iso-8859-1] Fri Jul 4 13:10:59 2008 @@ -30,7 +30,7 @@ ; Rich Text Files HKCR,".rtf","",0x00000000,"rtffile" HKCR,".rtf\shellnew","",0x00000000,"" -HKCR,".rft\shellnew","Data",0x00020000,"{\rtf1}" +HKCR,".rtf\shellnew","Data",0x00020000,"{\rtf1}" HKCR,"rtffile","",0x00000000,"Rich Text Document" HKCR,"rtffile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\wordpad.exe,-1404" HKCR,"rtffile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-2" Modified: trunk/reactos/boot/bootdata/hivecls_i386.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls_i386…
============================================================================== --- trunk/reactos/boot/bootdata/hivecls_i386.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivecls_i386.inf [iso-8859-1] Fri Jul 4 13:10:59 2008 @@ -30,7 +30,7 @@ ; Rich Text Files HKCR,".rtf","",0x00000000,"rtffile" HKCR,".rtf\shellnew","",0x00000000,"" -HKCR,".rft\shellnew","Data",0x00020000,"{\rtf1}" +HKCR,".rtf\shellnew","Data",0x00020000,"{\rtf1}" HKCR,"rtffile","",0x00000000,"Rich Text Document" HKCR,"rtffile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\wordpad.exe,-1404" HKCR,"rtffile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-2"
16 years, 5 months
1
0
0
0
[jimtabor] 34294: Use PostOrSend instead of just Send. Works much better.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Jul 4 12:55:56 2008 New Revision: 34294 URL:
http://svn.reactos.org/svn/reactos?rev=34294&view=rev
Log: Use PostOrSend instead of just Send. Works much better. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/focus.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/focus.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/focus.c [iso-8859-1] Fri Jul 4 12:55:56 2008 @@ -111,7 +111,7 @@ if (cWindow && (IntGetWndThreadId(cWindow) == OldTID)) { // FALSE if the window is being deactivated, // ThreadId that owns the window being activated. - co_IntSendMessage(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID); + co_IntPostOrSendMessage(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID); } } for (phWnd = List; *phWnd; ++phWnd) @@ -120,7 +120,7 @@ if (cWindow && (IntGetWndThreadId(cWindow) == NewTID)) { // TRUE if the window is being activated, // ThreadId that owns the window being deactivated. - co_IntSendMessage(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID); + co_IntPostOrSendMessage(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID); } } ExFreePool(List);
16 years, 5 months
1
0
0
0
[fireball] 34293: Peter Oberndorfer <kumbayo84@arcor.de> - Implement %p for scanf.
by fireball@svn.reactos.org
Author: fireball Date: Fri Jul 4 07:39:43 2008 New Revision: 34293 URL:
http://svn.reactos.org/svn/reactos?rev=34293&view=rev
Log: Peter Oberndorfer <kumbayo84(a)arcor.de> - Implement %p for scanf. Modified: trunk/reactos/lib/sdk/crt/string/scanf.h Modified: trunk/reactos/lib/sdk/crt/string/scanf.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/scanf.h…
============================================================================== --- trunk/reactos/lib/sdk/crt/string/scanf.h [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/string/scanf.h [iso-8859-1] Fri Jul 4 07:39:43 2008 @@ -149,6 +149,8 @@ } /* read type */ switch(*format) { + case 'p': + case 'P': /* pointer. */ case 'x': case 'X': /* hexadecimal integer. */ base = 16; @@ -179,7 +181,7 @@ if (width>0) width--; } /* look for leading indication of base */ - if (width!=0 && nch == '0') { + if (width!=0 && nch == '0' && *format != 'p' && *format != 'P') { nch = _GETC_(file); if (width>0) width--; seendigit=1;
16 years, 5 months
1
0
0
0
[fireball] 34292: Dmitry Gorbachev: - FreeLoader first reads entire ntoskrnl.exe (about 20M) into memory, then copies it to other address. Now, freeldr reads it straight to the place, not allocating extra memory for buffer. - Aleksey: This changes should be eventually adopted and merged into winldr's peloader.c. See issue #3447 for more details.
by fireball@svn.reactos.org
Author: fireball Date: Fri Jul 4 05:36:03 2008 New Revision: 34292 URL:
http://svn.reactos.org/svn/reactos?rev=34292&view=rev
Log: Dmitry Gorbachev: - FreeLoader first reads entire ntoskrnl.exe (about 20M) into memory, then copies it to other address. Now, freeldr reads it straight to the place, not allocating extra memory for buffer. - Aleksey: This changes should be eventually adopted and merged into winldr's peloader.c. See issue #3447 for more details. Modified: trunk/reactos/boot/freeldr/freeldr/include/reactos.h trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c Modified: trunk/reactos/boot/freeldr/freeldr/include/reactos.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/reactos.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/reactos.h [iso-8859-1] Fri Jul 4 05:36:03 2008 @@ -113,6 +113,14 @@ PVOID NTAPI +FrLdrReadAndMapImage( + IN FILE *Image, + IN PCHAR ShortName, + IN ULONG ImageType +); + +PVOID +NTAPI FrLdrLoadImage( IN PCHAR szFileName, IN INT nPos, Modified: trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c [iso-8859-1] Fri Jul 4 05:36:03 2008 @@ -432,6 +432,174 @@ } return STATUS_SUCCESS; +} + +PVOID +NTAPI +FrLdrReadAndMapImage(IN FILE *Image, + IN PCHAR Name, + IN ULONG ImageType) +{ + PVOID ImageBase, LoadBase, ReadBuffer; + ULONG ImageId = LoaderBlock.ModsCount; + ULONG i, Size, ImageSize, SizeOfHeaders; + PIMAGE_NT_HEADERS NtHeader; + PIMAGE_SECTION_HEADER Section; + NTSTATUS Status = STATUS_SUCCESS; + + /* Try to see, maybe it's loaded already */ + if (LdrGetModuleObject(Name) != NULL) + { + /* It's loaded, return NULL. It would be wise to return + correct LoadBase, but it seems to be ignored almost everywhere */ + return NULL; + } + + /* Set the virtual (image) and physical (load) addresses */ + LoadBase = (PVOID)NextModuleBase; + ImageBase = RVA(LoadBase, KSEG0_BASE); + + /* Allocate a temporary buffer for the read */ + ReadBuffer = MmHeapAlloc(MM_PAGE_SIZE); + if (!ReadBuffer) + { + /* Fail */ + DbgPrint("Failed to allocate a temporary buffer for the read\n"); + return NULL; + } + + /* Set the file pointer to zero */ + FsSetFilePointer(Image, 0); + + /* Load first page of the file image */ + if (!FsReadFile(Image, MM_PAGE_SIZE, NULL, ReadBuffer)) + { + /* Fail */ + DbgPrint("Failed to read image: %s\n", Name); + return NULL; + } + + /* Get image headers */ + NtHeader = RtlImageNtHeader(ReadBuffer); + + /* Allocate memory for the driver */ + ImageSize = NtHeader->OptionalHeader.SizeOfImage; + LoadBase = MmAllocateMemoryAtAddress(ImageSize, LoadBase, LoaderSystemCode); + ASSERT(LoadBase); + + /* Copy headers over */ + SizeOfHeaders = NtHeader->OptionalHeader.SizeOfHeaders; + if (SizeOfHeaders < MM_PAGE_SIZE) + { + RtlMoveMemory(LoadBase, ReadBuffer, SizeOfHeaders); + } + else + { + RtlMoveMemory(LoadBase, ReadBuffer, MM_PAGE_SIZE); + if (!FsReadFile(Image, SizeOfHeaders - MM_PAGE_SIZE, NULL, + (PVOID)((ULONG_PTR)LoadBase + MM_PAGE_SIZE))) + { + DbgPrint("Failed to read image: %s\n", Name); + return NULL; + } + } + + /* Free the temporary buffer */ + MmHeapFree(ReadBuffer); + + /* Get the first section */ + NtHeader = RtlImageNtHeader(LoadBase); + Section = IMAGE_FIRST_SECTION(NtHeader); + + /* Read image sections into virtual section */ + for (i = 0; i < NtHeader->FileHeader.NumberOfSections; i++) + { + /* Get the size of this section and check if it's valid */ + Size = Section[i].VirtualAddress + Section[i].Misc.VirtualSize; + if (Size <= ImageSize) + { + if (Section[i].SizeOfRawData) + { + /* Copy the data from the disk to the image */ + FsSetFilePointer(Image, Section[i].PointerToRawData); + if (!FsReadFile(Image, + Section[i].Misc.VirtualSize > + Section[i].SizeOfRawData ? + Section[i].SizeOfRawData : + Section[i].Misc.VirtualSize, + NULL, + (PVOID)((ULONG_PTR)LoadBase + + Section[i].VirtualAddress))) + { + DbgPrint("Failed to read image: %s\n", Name); + return NULL; + } + } + else + { + /* Clear the BSS area */ + RtlZeroMemory((PVOID)((ULONG_PTR)LoadBase + + Section[i].VirtualAddress), + Section[i].Misc.VirtualSize); + } + } + } + + /* Calculate Difference between Real Base and Compiled Base*/ + Status = LdrRelocateImageWithBias(LoadBase, + (ULONG_PTR)ImageBase - + (ULONG_PTR)LoadBase, + "FreeLdr", + STATUS_SUCCESS, + STATUS_UNSUCCESSFUL, + STATUS_UNSUCCESSFUL); + if (!NT_SUCCESS(Status)) + { + /* Fail */ + DbgPrint("Failed to relocate image: %s\n", Name); + return NULL; + } + + /* Fill out Module Data Structure */ + reactos_modules[ImageId].ModStart = (ULONG_PTR)ImageBase; + reactos_modules[ImageId].ModEnd = (ULONG_PTR)ImageBase + ImageSize; + strcpy(reactos_module_strings[ImageId], Name); + reactos_modules[ImageId].String = (ULONG_PTR)reactos_module_strings[ImageId]; + LoaderBlock.ModsCount++; + + /* Detect kernel or HAL */ + if (!_stricmp(Name, "ntoskrnl.exe")) + { + KernelData = (PVOID)NextModuleBase; + KernelSize = ImageSize; + } + else if (!_stricmp(Name, "hal.dll")) + { + HalData = (PVOID)NextModuleBase; + HalSize = ImageSize; + } + else + { + DriverName[Drivers] = reactos_module_strings[ImageId]; + DriverData[Drivers] = (PVOID)NextModuleBase; + DriverSize[Drivers] = ImageSize; + Drivers++; + } + + /* Increase the next Load Base */ + NextModuleBase = ROUND_UP(NextModuleBase + ImageSize, PAGE_SIZE); + + /* Perform import fixups */ + if (!NT_SUCCESS(LdrPEFixupImports(LoadBase, Name))) + { + /* Fixup failed, just don't include it in the list */ + // NextModuleBase = OldNextModuleBase; + LoaderBlock.ModsCount = ImageId; + return NULL; + } + + /* Return the final mapped address */ + return LoadBase; } ULONG @@ -519,6 +687,12 @@ /* Allocate a temporary buffer for the read */ ReadBuffer = MmHeapAlloc(ImageSize); + if (!ReadBuffer) + { + /* Fail */ + DbgPrint("Failed to allocate a temporary buffer for the read\n"); + return NULL; + } /* Load the file image */ if (!FsReadFile(Image, ImageSize, NULL, ReadBuffer)) Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] Fri Jul 4 05:36:03 2008 @@ -120,7 +120,7 @@ UiDrawStatusText(value); /* Load the driver */ - FrLdrMapImage(FilePointer, szFileName, 0); + FrLdrReadAndMapImage(FilePointer, szFileName, 0); /* Update status and return */ UiDrawProgressBarCenter(nPos, 100, szLoadingMsg); @@ -182,7 +182,7 @@ UiDrawStatusText(szBuffer); /* Do the actual loading */ - LoadBase = FrLdrMapImage(FilePointer, szShortName, ImageType); + LoadBase = FrLdrReadAndMapImage(FilePointer, szShortName, ImageType); /* Update Processbar and return success */ if (!FrLdrBootType) UiDrawProgressBarCenter(nPos, 100, szLoadingMsg); Modified: trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c [iso-8859-1] Fri Jul 4 05:36:03 2008 @@ -82,7 +82,7 @@ UiDrawStatusText(szBuffer); /* Do the actual loading */ - LoadBase = FrLdrMapImage(FilePointer, szShortName, 1); + LoadBase = FrLdrReadAndMapImage(FilePointer, szShortName, 1); /* Get the NT header, kernel base and kernel entry */ NtHeader = RtlImageNtHeader(LoadBase);
16 years, 5 months
1
0
0
0
[fireball] 34291: - There is no working strsafe lib yet, so including its header is meaningless.
by fireball@svn.reactos.org
Author: fireball Date: Fri Jul 4 03:45:01 2008 New Revision: 34291 URL:
http://svn.reactos.org/svn/reactos?rev=34291&view=rev
Log: - There is no working strsafe lib yet, so including its header is meaningless. Modified: trunk/reactos/include/dxsdk/DShow.h Modified: trunk/reactos/include/dxsdk/DShow.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/dxsdk/DShow.h?rev=…
============================================================================== --- trunk/reactos/include/dxsdk/DShow.h [iso-8859-1] (original) +++ trunk/reactos/include/dxsdk/DShow.h [iso-8859-1] Fri Jul 4 03:45:01 2008 @@ -20,12 +20,12 @@ #include <olectl.h> #include <ddraw.h> #include <mmsystem.h> - +/* #ifndef NO_DSHOW_STRSAFE #define NO_SHLWAPI_STRFCNS #include <strsafe.h> #endif - +*/ #ifndef NUMELMS #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0])) #endif
16 years, 5 months
1
0
0
0
[cfinck] 34290: Remove the strsafe library, it was imported from a dubious source, which is incompatible with the LGPL
by cfinck@svn.reactos.org
Author: cfinck Date: Fri Jul 4 03:24:37 2008 New Revision: 34290 URL:
http://svn.reactos.org/svn/reactos?rev=34290&view=rev
Log: Remove the strsafe library, it was imported from a dubious source, which is incompatible with the LGPL Removed: trunk/reactos/include/psdk/strsafe.h trunk/reactos/lib/sdk/strsafe/ Modified: trunk/reactos/lib/sdk/sdk.rbuild Removed: trunk/reactos/include/psdk/strsafe.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/strsafe.h?rev…
============================================================================== --- trunk/reactos/include/psdk/strsafe.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/strsafe.h (removed) @@ -1,454 +1,0 @@ -/* - * STRSAFE - * - * Copyright 2007 Dmitry Chapyshev <dmitry(a)reactos.org> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef _STRSAFE_H_INCLUDED_ -#define _STRSAFE_H_INCLUDED_ - -#ifdef __cplusplus -#define _STRSAFE_EXTERN_C extern "C" -extern "C" { -#else -#define _STRSAFE_EXTERN_C extern -#endif - -#include <string.h> -#include <stdarg.h> -#include <stdio.h> -#include <windows.h> - -#define STRSAFE_INLINE_API __inline HRESULT __stdcall -#define STRSAFEAPI _STRSAFE_EXTERN_C HRESULT __stdcall - -#ifndef _NTSTRSAFE_H_INCLUDED_ - -#define STRSAFE_MAX_CCH 2147483647 - -#define STRSAFE_FILL_BEHIND_NULL 0x00000200 -#define STRSAFE_IGNORE_NULLS 0x00000100 -#define STRSAFE_FILL_ON_FAILURE 0x00000400 -#define STRSAFE_NULL_ON_FAILURE 0x00000800 -#define STRSAFE_NO_TRUNCATION 0x00001000 -#define STRSAFE_IGNORE_NULL_UNICODE_STRINGS 0x00010000 -#define STRSAFE_UNICODE_STRING_DEST_NULL_TERMINATED 0x00020000 - -#define STRSAFE_VALID_FLAGS (0x000000FF | STRSAFE_IGNORE_NULLS | STRSAFE_FILL_BEHIND_NULL | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION) -#define STRSAFE_UNICODE_STRING_VALID_FLAGS (STRSAFE_VALID_FLAGS | STRSAFE_IGNORE_NULL_UNICODE_STRINGS | STRSAFE_UNICODE_STRING_DEST_NULL_TERMINATED) -#define STRSAFE_FILL_BYTE(x) ((unsigned long)((x & 0x000000FF) | STRSAFE_FILL_BEHIND_NULL)) -#define STRSAFE_FAILURE_BYTE(x) ((unsigned long)((x & 0x000000FF) | STRSAFE_FILL_ON_FAILURE)) -#define STRSAFE_GET_FILL_PATTERN(dwFlags) ((int)(dwFlags & 0x000000FF)) - -#endif /* _NTSTRSAFE_H_INCLUDED_ */ - -#define STRSAFE_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) -#define STRSAFE_E_INVALID_PARAMETER ((HRESULT)0x80070057L) -#define STRSAFE_E_END_OF_FILE ((HRESULT)0x80070026L) - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -STRSAFEAPI -StringCchCatA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc); - -STRSAFEAPI -StringCchCatW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszSrc); - -STRSAFEAPI -StringCchCatExA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - LPTSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCchCatExW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszSrc, - LPWSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCchCatNA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - size_t cchMaxAppend); - -STRSAFEAPI -StringCchCatNW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszSrc, - size_t cchMaxAppend); - -STRSAFEAPI -StringCchCatNExA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - size_t cchMaxAppend, - LPTSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCchCatNExW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszSrc, - size_t cchMaxAppend, - LPWSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCchCopyA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc); - -STRSAFEAPI -StringCchCopyW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszSrc); - -STRSAFEAPI -StringCchCopyExA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - LPTSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCchCopyExW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszSrc, - LPWSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCchCopyNA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - size_t cchSrc); - -STRSAFEAPI -StringCchCopyNW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszSrc, - size_t cchSrc); - -STRSAFEAPI -StringCchCopyNExA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - size_t cchSrc, - LPTSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCchCopyNExW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszSrc, - size_t cchSrc, - LPWSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFE_INLINE_API -StringCchGetsA(LPTSTR pszDest, - size_t cchDest); - -STRSAFE_INLINE_API -StringCchGetsW(LPWSTR pszDest, - size_t cchDest); - -STRSAFE_INLINE_API -StringCchGetsExA(LPTSTR pszDest, - size_t cchDest, - LPTSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFE_INLINE_API -StringCchGetsExW(LPWSTR pszDest, - size_t cchDest, - LPWSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCchVPrintfA(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszFormat, - va_list argList); - -STRSAFEAPI -StringCchVPrintfW(LPWSTR pszDest, - size_t cchDest, - LPCWSTR pszFormat, - va_list argList); - -STRSAFEAPI -StringCchVPrintfExA(LPTSTR pszDest, - size_t cchDest, - LPTSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags, - LPCTSTR pszFormat, - va_list argList); - -STRSAFEAPI -StringCchVPrintfExW(LPWSTR pszDest, - size_t cchDest, - LPWSTR *ppszDestEnd, - size_t* pcchRemaining, - unsigned long dwFlags, - LPCWSTR pszFormat, - va_list argList); - -STRSAFEAPI -StringCchLengthA(LPCTSTR psz, - size_t cchMax, - size_t* pcch); - -STRSAFEAPI -StringCchLengthW(LPCWSTR psz, - size_t cchMax, - size_t* pcch); -#endif /* STRSAFE_NO_CCH_FUNCTIONS */ - -/* CB */ -#ifndef STRSAFE_NO_CB_FUNCTIONS -STRSAFEAPI -StringCbCatA(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc); - -STRSAFEAPI -StringCbCatW(LPWSTR pszDest, - size_t cbDest, - LPCWSTR pszSrc); - -STRSAFEAPI -StringCbCatExA(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc, - LPTSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCbCatExW(LPWSTR pszDest, - size_t cbDest, - LPCWSTR pszSrc, - LPWSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCbCopyA(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc); - -STRSAFEAPI -StringCbCopyW(LPWSTR pszDest, - size_t cbDest, - LPCWSTR pszSrc); - -STRSAFEAPI -StringCbCopyExA(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc, - LPTSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCbCopyExW(LPWSTR pszDest, - size_t cbDest, - LPCWSTR pszSrc, - LPWSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCbCopyNA(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc, - size_t cbSrc); - -STRSAFEAPI -StringCbCopyNW(LPWSTR pszDest, - size_t cbDest, - LPCWSTR pszSrc, - size_t cbSrc); - -STRSAFEAPI -StringCbCopyNExA(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc, - size_t cbSrc, - LPTSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCbCopyNExW(LPWSTR pszDest, - size_t cbDest, - LPCWSTR pszSrc, - size_t cbSrc, - LPWSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags); - -STRSAFE_INLINE_API -StringCbGetsA(LPTSTR pszDest, - size_t cbDest); - -STRSAFE_INLINE_API -StringCbGetsW(LPWSTR pszDest, - size_t cbDest); - -STRSAFE_INLINE_API -StringCbGetsExA(LPTSTR pszDest, - size_t cbDest, - LPTSTR *ppszDestEnd, - size_t* pbRemaining, - unsigned long dwFlags); - -STRSAFE_INLINE_API -StringCbGetsExW(LPWSTR pszDest, - size_t cbDest, - LPWSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags); - -STRSAFEAPI -StringCbPrintfA(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszFormat, - ...); - -STRSAFEAPI -StringCbPrintfW(LPWSTR pszDest, - size_t cbDest, - LPCWSTR pszFormat, - ...); - -STRSAFEAPI -StringCbPrintfExA(LPTSTR pszDest, - size_t cbDest, - LPTSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags, - LPCTSTR pszFormat, - ...); - -STRSAFEAPI -StringCbPrintfExW(LPWSTR pszDest, - size_t cbDest, - LPWSTR *ppszDestEnd, - size_t* pcbRemaining, - unsigned long dwFlags, - LPCWSTR pszFormat, - ...); -#endif /* STRSAFE_NO_CB_FUNCTIONS */ - -#ifdef UNICODE -#ifndef STRSAFE_NO_CCH_FUNCTIONS -#define StringCchCat StringCchCatW -#define StringCchCatEx StringCchCatExW -#define StringCchCatN StringCchCatNW -#define StringCchCatNEx StringCchCatNExW -#define StringCchCopy StringCchCopyW -#define StringCchCopyEx StringCchCopyExW -#define StringCchCopyN StringCchCopyNW -#define StringCchCopyNEx StringCchCopyNExW -#define StringCchGets StringCchGetsW -#define StringCchGetsEx StringCchGetsExW -#define StringCchPrintf StringCchPrintfW -#define StringCchPrintfEx StringCchPrintfExW -#define StringCchVPrintf StringCchVPrintfW -#define StringCchVPrintfEx StringCchVPrintfExW -#define StringCchLength StringCchLengthW -#endif /* STRSAFE_NO_CCH_FUNCTIONS */ - -#ifndef STRSAFE_NO_CB_FUNCTIONS -#define StringCbCat StringCbCatW -#define StringCbCatEx StringCbCatExW -#define StringCbCatN StringCbCatNW -#define StringCbCatNEx StringCbCatNExW -#define StringCbCopy StringCbCopyW -#define StringCbCopyEx StringCbCopyExW -#define StringCbCopyN StringCbCopyNW -#define StringCbCopyNEx StringCbCopyNExW -#define StringCbGets StringCbGetsW -#define StringCbGetsEx StringCbGetsExW -#define StringCbPrintf StringCbPrintfW -#define StringCbPrintfEx StringCbPrintfExW -#define StringCbVPrintf StringCbVPrintfW -#define StringCbVPrintfEx StringCbVPrintfExW -#define StringCbLenght StringCbLenghtW -#endif /* STRSAFE_NO_CB_FUNCTIONS */ - -#else -#ifndef STRSAFE_NO_CCH_FUNCTIONS -#define StringCchCat StringCchCatA -#define StringCchCatEx StringCchCatExA -#define StringCchCatN StringCchCatNA -#define StringCchCatNEx StringCchCatNExA -#define StringCchCopy StringCchCopyA -#define StringCchCopyEx StringCchCopyExA -#define StringCchCopyN StringCchCopyNA -#define StringCchCopyNEx StringCchCopyNExA -#define StringCchGets StringCchGetsA -#define StringCchGetsEx StringCchGetsExA -#define StringCchPrintf StringCchPrintfA -#define StringCchPrintfEx StringCchPrintfExA -#define StringCchVPrintf StringCchVPrintfA -#define StringCchVPrintfEx StringCchVPrintfExA -#define StringCchLength StringCchLengthA -#endif /* STRSAFE_NO_CCH_FUNCTIONS */ - -#ifndef STRSAFE_NO_CB_FUNCTIONS -#define StringCbCat StringCbCatA -#define StringCbCatEx StringCbCatExA -#define StringCbCatN StringCbCatNA -#define StringCbCatNEx StringCbCatNExA -#define StringCbCopy StringCbCopyA -#define StringCbCopyEx StringCbCopyExA -#define StringCbCopyN StringCbCopyNA -#define StringCbCopyNEx StringCbCopyNExA -#define StringCbGets StringCbGetsA -#define StringCbGetsEx StringCbGetsExA -#define StringCbPrintf StringCbPrintfA -#define StringCbPrintfEx StringCbPrintfExA -#define StringCbVPrintf StringCbVPrintfA -#define StringCbVPrintfEx StringCbVPrintfExA -#define StringCbLenght StringCbLenghtA -#endif /* STRSAFE_NO_CB_FUNCTIONS */ -#endif /* UNICODE */ - -#ifdef __cplusplus -} -#endif /* cplusplus */ - -#endif /* _STRSAFE_H_INCLUDED_ */ Modified: trunk/reactos/lib/sdk/sdk.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/sdk.rbuild?rev=342…
============================================================================== --- trunk/reactos/lib/sdk/sdk.rbuild [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/sdk.rbuild [iso-8859-1] Fri Jul 4 03:24:37 2008 @@ -23,7 +23,4 @@ <directory name="scrnsave"> <xi:include href="scrnsave/scrnsave.rbuild" /> </directory> - <directory name="strsafe"> - <xi:include href="strsafe/strsafe.rbuild" /> - </directory> </group>
16 years, 5 months
1
0
0
0
[jimtabor] 34289: - Moved WM_ACTIVATEAPP calles before WM_NC/ACTIVATE calls. - Implemented GetLastActivePopup, based on wine. - Fixed DCE, pass all tests, except six clipping and one ROP check, which might be due to DCX_NORESETATTRS flag not being reset during the next GetDCEx call. <Researching>
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Jul 3 23:55:18 2008 New Revision: 34289 URL:
http://svn.reactos.org/svn/reactos?rev=34289&view=rev
Log: - Moved WM_ACTIVATEAPP calles before WM_NC/ACTIVATE calls. - Implemented GetLastActivePopup, based on wine. - Fixed DCE, pass all tests, except six clipping and one ROP check, which might be due to DCX_NORESETATTRS flag not being reset during the next GetDCEx call. <Researching> Modified: trunk/reactos/dll/win32/user32/windows/window.c trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/ntuser/focus.c trunk/reactos/subsystems/win32/win32k/ntuser/windc.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c Modified: trunk/reactos/dll/win32/user32/windows/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Thu Jul 3 23:55:18 2008 @@ -1,5 +1,4 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/window.c @@ -916,21 +915,21 @@ /* - * @unimplemented + * @implemented */ HWND STDCALL GetLastActivePopup(HWND hWnd) { - PWINDOW Wnd, WndParent; - HWND Ret = NULL; - WARN("Not fully implemented!"); + PWINDOW Wnd; + HWND Ret = hWnd; + Wnd = ValidateHwnd(hWnd); if (Wnd != NULL) { _SEH_TRY { - WndParent = NULL; - Ret = hWnd; + if (Wnd->hWndLastActive) + Ret = Wnd->hWndLastActive; } _SEH_HANDLE { Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Thu Jul 3 23:55:18 2008 @@ -153,6 +153,8 @@ UNICODE_STRING WindowName; /* Context help id */ DWORD ContextHelpId; + + HWND hWndLastActive; struct { Modified: trunk/reactos/subsystems/win32/win32k/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/focus.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/focus.c [iso-8859-1] Thu Jul 3 23:55:18 2008 @@ -16,7 +16,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id$ */ #include <w32k.h> @@ -85,17 +84,12 @@ co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, (LPARAM) hWnd); } - UserDerefObjectCo(Window); - - /* FIXME: IntIsWindow */ - - CHECKPOINT; - co_IntPostOrSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == UserGetForegroundWindow()), 0); - /* FIXME: WA_CLICKACTIVE */ - co_IntPostOrSendMessage(hWnd, WM_ACTIVATE, - MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE, - UserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE), - (LPARAM)hWndPrev); + if (Window->Wnd) + { // Set last active for window and it's owner. + Window->Wnd->hWndLastActive = hWnd; + if (Window->Wnd->Owner) + Window->Wnd->Owner->hWndLastActive = hWnd; + } if (Window && hWndPrev) { @@ -133,6 +127,18 @@ } } } + + UserDerefObjectCo(Window); + + /* FIXME: IntIsWindow */ + + CHECKPOINT; + co_IntPostOrSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == UserGetForegroundWindow()), 0); + /* FIXME: WA_CLICKACTIVE */ + co_IntPostOrSendMessage(hWnd, WM_ACTIVATE, + MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE, + UserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE), + (LPARAM)hWndPrev); } } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] Thu Jul 3 23:55:18 2008 @@ -220,16 +220,6 @@ dce->DCXFlags |= DCX_DCEEMPTY; } } - else - { // Save Users Dc_Attr. - PDC dc = DC_LockDc(dce->hDC); - if(dc) - { - PDC_ATTR Dc_Attr = dc->pDc_Attr; - if(Dc_Attr) MmCopyFromCaller(&dc->Dc_Attr, Dc_Attr, sizeof(DC_ATTR)); - DC_UnlockDc(dc); - } - } dce->DCXFlags &= ~DCX_DCEBUSY; DPRINT("Exit!!!!! DCX_CACHE!!!!!! hDC-> %x \n", dce->hDC); if (!IntGdiSetDCOwnerEx( dce->hDC, GDI_OBJ_HMGR_NONE, FALSE)) @@ -427,17 +417,8 @@ // Window nz, check to see if we still own this or it is just cheap wine tonight. if (!(Flags & DCX_CACHE)) { - if ( Wnd->ti != GetW32ThreadInfo()) Flags |= DCX_CACHE; // Ah~ Not Powned! Forced to be cheap~ - // Can only have one POWNED or CLASS. - if ( !Window->Dce && (Wnd->Class->Style & CS_OWNDC)) - Window->Dce = DceAllocDCE(NULL, DCE_WINDOW_DC); - else - Flags |= DCX_CACHE; - - if ( !Wnd->Class->Dce && (Wnd->Class->Style & CS_CLASSDC)) - Wnd->Class->Dce = DceAllocDCE(NULL, DCE_CLASS_DC); - else - Flags |= DCX_CACHE; + if ( Wnd->ti != GetW32ThreadInfo()) + Flags |= DCX_CACHE; // Ah~ Not Powned! Forced to be cheap~ } DcxFlags = Flags & DCX_CACHECOMPAREMASK; @@ -455,7 +436,10 @@ // Need to test for null here. Not sure if this is a bug or a feature. // First time use hax, need to use DceAllocDCE during window display init. if (!Dce) break; - +// +// The way I understand this, you can have more than one DC per window. +// Only one Owned if one was requested and saved and one Cached. +// if ((Dce->DCXFlags & (DCX_CACHE | DCX_DCEBUSY)) == DCX_CACHE) { DceUnused = Dce; @@ -469,7 +453,6 @@ #if 0 /* FIXME */ UpdateVisRgn = FALSE; #endif - UpdateClipOrigin = TRUE; break; } @@ -531,8 +514,6 @@ /* FIXME: Handle error */ } - Dce->DCXFlags = Flags | DCX_DCEBUSY; - if (!(Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && ClipRegion) { if (!(Flags & DCX_KEEPCLIPRGN)) @@ -546,6 +527,8 @@ DceDeleteClipRgn(Dce); } #endif + + Dce->DCXFlags = Flags | DCX_DCEBUSY; if (0 != (Flags & DCX_INTERSECTUPDATE) && NULL == ClipRegion) { Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Thu Jul 3 23:55:18 2008 @@ -1627,6 +1627,7 @@ Wnd->ti = ti; Wnd->pi = ti->kpi; + Wnd->hWndLastActive = hWnd; } DPRINT("Created object with handle %X\n", hWnd);
16 years, 5 months
1
0
0
0
← Newer
1
...
67
68
69
70
71
72
73
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200