Author: jgardou
Date: Tue Apr 2 12:45:31 2013
New Revision: 58641
URL:
http://svn.reactos.org/svn/reactos?rev=58641&view=rev
Log:
[STDUNK]
* Add library, implementing the CUnknown interface for WDM audio drivers
Added:
trunk/reactos/lib/drivers/sound/stdunk/ (with props)
trunk/reactos/lib/drivers/sound/stdunk/CMakeLists.txt (with props)
trunk/reactos/lib/drivers/sound/stdunk/cunknown.cpp (with props)
Modified:
trunk/reactos/lib/drivers/sound/CMakeLists.txt
Modified: trunk/reactos/lib/drivers/sound/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/CMakeLis…
==============================================================================
--- trunk/reactos/lib/drivers/sound/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/CMakeLists.txt [iso-8859-1] Tue Apr 2 12:45:31 2013
@@ -5,4 +5,5 @@
add_subdirectory(mmixer)
add_subdirectory(shared)
#add_subdirectory(soundblaster) Nothing links to this lib.
+add_subdirectory(stdunk)
add_subdirectory(uartmidi)
Propchange: trunk/reactos/lib/drivers/sound/stdunk/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Tue Apr 2 12:45:31 2013
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/reactos/lib/drivers/sound/stdunk/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/reactos/lib/drivers/sound/stdunk/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/lib/drivers/sound/stdunk/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: trunk/reactos/lib/drivers/sound/stdunk/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/stdunk/C…
==============================================================================
--- trunk/reactos/lib/drivers/sound/stdunk/CMakeLists.txt (added)
+++ trunk/reactos/lib/drivers/sound/stdunk/CMakeLists.txt [iso-8859-1] Tue Apr 2 12:45:31
2013
@@ -1,0 +1,10 @@
+
+set_cpp()
+
+add_library(stdunk STATIC cunknown.cpp)
+
+if(MSVC)
+ add_target_compile_flags(stdunk "/GR-")
+else()
+ add_target_compile_flags(stdunk "-fno-exceptions -fno-rtti")
+endif()
Propchange: trunk/reactos/lib/drivers/sound/stdunk/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/lib/drivers/sound/stdunk/cunknown.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/stdunk/c…
==============================================================================
--- trunk/reactos/lib/drivers/sound/stdunk/cunknown.cpp (added)
+++ trunk/reactos/lib/drivers/sound/stdunk/cunknown.cpp [iso-8859-1] Tue Apr 2 12:45:31
2013
@@ -1,0 +1,72 @@
+/*
+ ReactOS Kernel-Mode COM
+ IUnknown implementations
+
+ LICENSE
+ Please see COPYING in the top-level directory for license information.
+
+ AUTHORS
+ Andrew Greenwood
+*/
+
+#include <stdunk.h>
+
+CUnknown::CUnknown(PUNKNOWN outer_unknown)
+{
+ m_ref_count = 0;
+
+ if ( outer_unknown )
+ m_outer_unknown = outer_unknown;
+ else
+ m_outer_unknown = PUNKNOWN(dynamic_cast<PNONDELEGATINGUNKNOWN>(this));
+}
+
+CUnknown::~CUnknown()
+{
+}
+
+STDMETHODIMP_(ULONG)
+CUnknown::NonDelegatingAddRef()
+{
+ InterlockedIncrement(&m_ref_count);
+ return m_ref_count;
+}
+
+STDMETHODIMP_(ULONG)
+CUnknown::NonDelegatingRelease()
+{
+ if ( InterlockedDecrement(&m_ref_count) == 0 )
+ {
+ m_ref_count ++;
+ delete this;
+ return 0;
+ }
+
+ return m_ref_count;
+}
+
+STDMETHODIMP_(NTSTATUS)
+CUnknown::NonDelegatingQueryInterface(
+ IN REFIID iid,
+ PVOID* ppVoid)
+{
+ /* FIXME */
+ #if 0
+ if ( IsEqualGUID(iid, IID_IUnknown) ) /* TODO: Aligned? */
+ *ppVoid = PVOID(PUNKNOWN(this));
+ else
+ *ppVoid = NULL;
+ #endif
+
+ if ( *ppVoid )
+ {
+ PUNKNOWN(*ppVoid)->AddRef();
+ return STATUS_SUCCESS;
+ }
+
+ return STATUS_INVALID_PARAMETER;
+}
+
+#if __GNUC__
+extern "C" void __cxa_pure_virtual() { ASSERT(FALSE); }
+#endif
Propchange: trunk/reactos/lib/drivers/sound/stdunk/cunknown.cpp
------------------------------------------------------------------------------
svn:eol-style = native