[PORTCLS]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 23 Feb 2011 15:14:12 +0000 (15:14 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 23 Feb 2011 15:14:12 +0000 (15:14 +0000)
- Re-add the hack for gcc

svn path=/trunk/; revision=50877

reactos/drivers/wdm/audio/backpln/portcls/dma_slave.cpp
reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp

index 35109f0..7aefa8e 100644 (file)
@@ -194,6 +194,8 @@ CDmaChannelInit::MaximumBufferSize()
     return m_MaximumBufferSize;
 }
 
     return m_MaximumBufferSize;
 }
 
+#ifdef _MSC_VER
+
 PHYSICAL_ADDRESS
 NTAPI
 CDmaChannelInit::PhysicalAddress()
 PHYSICAL_ADDRESS
 NTAPI
 CDmaChannelInit::PhysicalAddress()
@@ -203,6 +205,24 @@ CDmaChannelInit::PhysicalAddress()
     return m_Address;
 }
 
     return m_Address;
 }
 
+#else
+
+PHYSICAL_ADDRESS
+NTAPI
+CDmaChannelInit::PhysicalAddress(
+    PPHYSICAL_ADDRESS Address)
+{
+    DPRINT("CDmaChannelInit_PhysicalAdress: this %p Virtuell %p Physical High %x Low %x%\n", this, m_Buffer, m_Address.HighPart, m_Address.LowPart);
+
+    PHYSICAL_ADDRESS Result;
+
+    Address->QuadPart = m_Address.QuadPart;
+    Result.QuadPart = (PtrToUlong(Address));
+    return Result;
+}
+
+
+#endif
 
 VOID
 NTAPI
 
 VOID
 NTAPI
index bec3ccd..8e3f705 100644 (file)
@@ -106,7 +106,7 @@ DEFINE_GUID(IID_IIrpTargetFactory, 0xB4C90A62, 0x5791, 0x11D0, 0xF9, 0x86, 0x00,
         IN PDEVICE_OBJECT DeviceObject,                    \
         IN PIRP Irp)PURE;                                  \
                                                            \
         IN PDEVICE_OBJECT DeviceObject,                    \
         IN PIRP Irp)PURE;                                  \
                                                            \
-    STDMETHOD_(NTSTATUS, Close)(THIS_                      \
+    virtual NTSTATUS Close(                      \
         IN PDEVICE_OBJECT DeviceObject,                    \
         IN PIRP Irp)PURE;                                  \
                                                            \
         IN PDEVICE_OBJECT DeviceObject,                    \
         IN PIRP Irp)PURE;                                  \
                                                            \
@@ -888,6 +888,8 @@ typedef IPortPinDMus *PPORTPINDMUS;
  *****************************************************************************
  */
 
  *****************************************************************************
  */
 
+#ifdef _MSC_VER
+
 #define IMP_IDmaChannelEx                                                 \
     STDMETHODIMP_(NTSTATUS) AllocateBuffer(                               \
         IN  ULONG BufferSize,                                             \
 #define IMP_IDmaChannelEx                                                 \
     STDMETHODIMP_(NTSTATUS) AllocateBuffer(                               \
         IN  ULONG BufferSize,                                             \
@@ -916,6 +918,42 @@ typedef IPortPinDMus *PPORTPINDMUS;
         IN  PVOID Source,                                                 \
         IN  ULONG ByteCount)
 
         IN  PVOID Source,                                                 \
         IN  ULONG ByteCount)
 
+#else
+
+#define IMP_IDmaChannelEx                                                 \
+    STDMETHODIMP_(NTSTATUS) AllocateBuffer(                               \
+        IN  ULONG BufferSize,                                             \
+        IN  PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL);        \
+                                                                          \
+    STDMETHODIMP_(void) FreeBuffer(void);                                 \
+    STDMETHODIMP_(ULONG) TransferCount(void);                             \
+    STDMETHODIMP_(ULONG) MaximumBufferSize(void);                         \
+    STDMETHODIMP_(ULONG) AllocatedBufferSize(void);                       \
+    STDMETHODIMP_(ULONG) BufferSize(void);                                \
+                                                                          \
+    STDMETHODIMP_(void) SetBufferSize(                                    \
+        IN  ULONG BufferSize);                                            \
+                                                                          \
+    STDMETHODIMP_(PVOID) SystemAddress(void);                             \
+    STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress(                      \
+        IN  PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL);        \
+    STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject(void);                \
+                                                                          \
+    STDMETHODIMP_(void) CopyTo(                                           \
+        IN  PVOID Destination,                                            \
+        IN  PVOID Source,                                                 \
+        IN  ULONG ByteCount);                                             \
+                                                                          \
+    STDMETHODIMP_(void) CopyFrom(                                         \
+        IN  PVOID Destination,                                            \
+        IN  PVOID Source,                                                 \
+        IN  ULONG ByteCount)
+
+
+
+#endif
+
+
 #define IMP_IDmaChannelSlaveEx                 \
     IMP_IDmaChannelEx;                         \
     STDMETHODIMP_(NTSTATUS) Start(             \
 #define IMP_IDmaChannelSlaveEx                 \
     IMP_IDmaChannelEx;                         \
     STDMETHODIMP_(NTSTATUS) Start(             \
@@ -934,6 +972,8 @@ typedef IPortPinDMus *PPORTPINDMUS;
         IN  PDEVICE_DESCRIPTION DeviceDescription, \
         IN  PDEVICE_OBJECT DeviceObject)
 
         IN  PDEVICE_DESCRIPTION DeviceDescription, \
         IN  PDEVICE_OBJECT DeviceObject)
 
+#ifdef _MSC_VER
+
 #define DEFINE_ABSTRACT_DMACHANNEL_EX() \
     STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
         IN  ULONG BufferSize, \
 #define DEFINE_ABSTRACT_DMACHANNEL_EX() \
     STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
         IN  ULONG BufferSize, \
@@ -961,7 +1001,38 @@ typedef IPortPinDMus *PPORTPINDMUS;
         IN  PVOID Destination, \
         IN  PVOID Source, \
         IN  ULONG ByteCount) PURE;
         IN  PVOID Destination, \
         IN  PVOID Source, \
         IN  ULONG ByteCount) PURE;
+#else
+
+#define DEFINE_ABSTRACT_DMACHANNEL_EX() \
+    STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
+        IN  ULONG BufferSize, \
+        IN  PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL) PURE; \
+\
+    STDMETHOD_(void, FreeBuffer)( THIS ) PURE; \
+    STDMETHOD_(ULONG, TransferCount)( THIS ) PURE; \
+    STDMETHOD_(ULONG, MaximumBufferSize)( THIS ) PURE; \
+    STDMETHOD_(ULONG, AllocatedBufferSize)( THIS ) PURE; \
+    STDMETHOD_(ULONG, BufferSize)( THIS ) PURE; \
+\
+    STDMETHOD_(void, SetBufferSize)( THIS_ \
+        IN  ULONG BufferSize) PURE; \
+\
+    STDMETHOD_(PVOID, SystemAddress)( THIS ) PURE; \
+    STDMETHOD_(PHYSICAL_ADDRESS, PhysicalAddress)( THIS_       \
+        IN PPHYSICAL_ADDRESS Address) PURE; \
+    STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \
+\
+    STDMETHOD_(void, CopyTo)( THIS_ \
+        IN  PVOID Destination, \
+        IN  PVOID Source, \
+        IN  ULONG ByteCount) PURE; \
+\
+    STDMETHOD_(void, CopyFrom)( THIS_ \
+        IN  PVOID Destination, \
+        IN  PVOID Source, \
+        IN  ULONG ByteCount) PURE;
 
 
+#endif
 #undef INTERFACE
 #define INTERFACE IDmaChannelInit
 
 #undef INTERFACE
 #define INTERFACE IDmaChannelInit