PATCH: IKsPropertySet

Marcus Meissner marcus at jet.franken.de
Tue Jun 12 16:03:06 CDT 2001


Hi,

IKsPropertySet is another undocumented method to access lowlevel hardware...

We just ignore any callers at this time.

Ciao, Marcus
Changelog:
	Added definitions for IKsPropertySet, small stub implementation
	for IDirectSound3DBuffer. Fixed one pointer reference.

Index: include/winerror.h
===================================================================
RCS file: /home/wine/wine/include/winerror.h,v
retrieving revision 1.36
diff -u -r1.36 winerror.h
--- include/winerror.h	2001/05/24 18:45:07	1.36
+++ include/winerror.h	2001/06/12 21:54:15
@@ -1879,6 +1879,10 @@
 #define E_OUTOFMEMORY                                      0x8007000EL
 #define E_INVALIDARG                                       0x80070057L
 
+/* For IKsPropertySets */
+#define E_PROP_ID_UNSUPPORTED				   0x80070490L
+#define E_PROP_SET_UNSUPPORTED				   0x80070492L
+
 #define CO_S_NOTALLINTERFACES                              0x00080012L
 
 #define CO_E_CLASS_CREATE_FAILED                           0x80080001L
Index: include/dsound.h
===================================================================
RCS file: /home/wine/wine/include/dsound.h,v
retrieving revision 1.18
diff -u -r1.18 dsound.h
--- include/dsound.h	2000/06/11 20:07:59	1.18
+++ include/dsound.h	2001/06/12 21:54:15
@@ -36,6 +36,7 @@
 typedef struct IDirectSoundCaptureBuffer IDirectSoundCaptureBuffer,*LPDIRECTSOUNDCAPTUREBUFFER;
 
 DEFINE_GUID(IID_IKsPropertySet,		0x31EFAC30,0x515C,0x11D0,0xA9,0xAA,0x00,0xAA,0x00,0x61,0xBE,0x93);
+typedef struct IKsPropertySet IKsPropertySet,*LPKSPROPERTYSET;
 
 
 #define	_FACDS		0x878
@@ -554,7 +555,26 @@
 /*****************************************************************************
  * IKsPropertySet interface
  */
-/* FIXME: not implemented yet */
+#define KSPROPERTY_SUPPORT_GET	1
+#define KSPROPERTY_SUPPORT_SET	2
+
+#define ICOM_INTERFACE IKsPropertySet
+#define IKsPropertySet_METHODS \
+    ICOM_METHOD7(HRESULT,Get,REFGUID,rgid,ULONG,x1,LPVOID,p1,ULONG,x2,LPVOID,p2,ULONG,x3,ULONG*,px4);\
+    ICOM_METHOD6(HRESULT,Set,REFGUID,rgid,ULONG,x1,LPVOID,p1,ULONG,x2,LPVOID,p2,ULONG,x3);\
+    ICOM_METHOD3(HRESULT,QuerySupport,REFGUID,rgid,ULONG,x1,ULONG*,px2);
+#define IKsPropertySet_IMETHODS \
+        IUnknown_IMETHODS \
+	IKsPropertySet_METHODS
+ICOM_DEFINE(IKsPropertySet,IUnknown)
+#undef ICOM_INTERFACE
+
+#define IKsPropertySet_QueryInterface(p,a,b)	ICOM_CALL2(QueryInterface,p,a,b)
+#define IKsPropertySet_AddRef(p)		ICOM_CALL (AddRef,p)
+#define IKsPropertySet_Release(p)		ICOM_CALL (Release,p)
+#define IKsPropertySet_Get(p,a,b,c,d,e,f,g)	ICOM_CALL7(Get,p,a,b,c,d,e,f,g)
+#define IKsPropertySet_Set(p,a,b,c,d,e,f)	ICOM_CALL6(Set,p,a,b,c,d,e,f)
+#define IKsPropertySet_QuerySupport(p,a,b,c)	ICOM_CALL3(QuerySupport,p,a,b,c)
 
 #ifdef __cplusplus
 } /* extern "C" */
Index: dlls/dsound/dsound_main.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/dsound_main.c,v
retrieving revision 1.44
diff -u -r1.44 dsound_main.c
--- dlls/dsound/dsound_main.c	2001/05/24 18:44:25	1.44
+++ dlls/dsound/dsound_main.c	2001/06/12 21:54:24
@@ -72,6 +72,7 @@
 typedef struct IDirectSound3DBufferImpl IDirectSound3DBufferImpl;
 typedef struct IDirectSoundCaptureImpl IDirectSoundCaptureImpl;
 typedef struct IDirectSoundCaptureBufferImpl IDirectSoundCaptureBufferImpl;
+typedef struct IKsPropertySetImpl IKsPropertySetImpl;
 
 /*****************************************************************************
  * IDirectSound implementation structure
@@ -161,6 +162,15 @@
     CRITICAL_SECTION        lock;   
 };
 
+struct IKsPropertySetImpl 
+{
+    /* IUnknown fields */
+    ICOM_VFIELD(IKsPropertySet);
+    DWORD			ref;
+    /* IKsPropertySetImpl fields */
+    IDirectSound3DBufferImpl	*ds3db;	/* backptr, no ref */
+};
+
 /*****************************************************************************
  * IDirectSound3DBuffer implementation structure
  */
@@ -175,6 +185,7 @@
     LPBYTE                  buffer;
     DWORD                   buflen;
     CRITICAL_SECTION        lock;
+    IKsPropertySetImpl*     iks;
 };
 
 
@@ -318,6 +329,76 @@
 }
 
 /*******************************************************************************
+ *              IKsPropertySet
+ */
+
+/* IUnknown methods */
+static HRESULT WINAPI IKsPropertySetImpl_QueryInterface(
+	LPKSPROPERTYSET iface, REFIID riid, LPVOID *ppobj
+) {
+	ICOM_THIS(IKsPropertySetImpl,iface);
+
+	FIXME("(%p,%s,%p), stub!\n",This,debugstr_guid(riid),ppobj);
+	return E_FAIL;
+}
+
+static ULONG WINAPI IKsPropertySetImpl_AddRef(LPKSPROPERTYSET iface) {
+	ICOM_THIS(IKsPropertySetImpl,iface);
+
+	This->ref++;
+	return This->ref;
+}
+
+static ULONG WINAPI IKsPropertySetImpl_Release(LPKSPROPERTYSET iface) {
+	ICOM_THIS(IKsPropertySetImpl,iface);
+
+	This->ref--;
+	return This->ref;
+}
+
+static HRESULT WINAPI IKsPropertySetImpl_Get(LPKSPROPERTYSET iface,
+	REFGUID guidPropSet, ULONG dwPropID,
+	LPVOID pInstanceData, ULONG cbInstanceData,
+	LPVOID pPropData, ULONG cbPropData,
+	PULONG pcbReturned
+) {
+	ICOM_THIS(IKsPropertySetImpl,iface);
+
+	FIXME("(%p,%s,%ld,%p,%ld,%p,%ld,%p), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
+	return E_PROP_ID_UNSUPPORTED;
+}
+
+static HRESULT WINAPI IKsPropertySetImpl_Set(LPKSPROPERTYSET iface,
+	REFGUID guidPropSet, ULONG dwPropID,
+	LPVOID pInstanceData, ULONG cbInstanceData,
+	LPVOID pPropData, ULONG cbPropData
+) {
+	ICOM_THIS(IKsPropertySetImpl,iface);
+
+	FIXME("(%p,%s,%ld,%p,%ld,%p,%ld), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
+	return E_PROP_ID_UNSUPPORTED;
+}
+
+static HRESULT WINAPI IKsPropertySetImpl_QuerySupport(LPKSPROPERTYSET iface,
+	REFGUID guidPropSet, ULONG dwPropID, PULONG pTypeSupport
+) {
+	ICOM_THIS(IKsPropertySetImpl,iface);
+
+	FIXME("(%p,%s,%ld,%p), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
+	return E_PROP_ID_UNSUPPORTED;
+}
+
+static ICOM_VTABLE(IKsPropertySet) iksvt = {
+	ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+	IKsPropertySetImpl_QueryInterface,
+	IKsPropertySetImpl_AddRef,
+	IKsPropertySetImpl_Release,
+	IKsPropertySetImpl_Get,
+	IKsPropertySetImpl_Set,
+	IKsPropertySetImpl_QuerySupport
+};
+
+/*******************************************************************************
  *              IDirectSound3DBuffer
  */
 
@@ -328,7 +409,13 @@
 {
 	ICOM_THIS(IDirectSound3DBufferImpl,iface);
 
-	TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
+	if ( IsEqualGUID( &IID_IKsPropertySet, riid ) ) {
+	    IDirectSound3DBuffer_AddRef(iface);
+	    *ppobj = This->iks;
+	    return S_OK;
+	}
+
+	FIXME("(%p,%s,%p), no such interface.\n",This,debugstr_guid(riid),ppobj);
 	return E_FAIL;
 }
 #endif
@@ -1777,7 +1864,7 @@
                 ICOM_VTBL(ds3db) = &ds3dbvt;
 		InitializeCriticalSection(&ds3db->lock);
 
-		IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER)This);
+		IDirectSoundBuffer_AddRef(iface);
 
                 ds3db->ds3db.dwSize = sizeof(DS3DBUFFER);
                 ds3db->ds3db.vPosition.u1.x = 0.0;
@@ -1802,6 +1889,11 @@
                         ds3db->ds3db.dwMode = DS3DMODE_DISABLE;
                 }
 
+		ds3db->iks = (IKsPropertySetImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(*(ds3db->iks)));
+		ds3db->iks->ref = 1;
+		ds3db->iks->ds3db = ds3db;
+		ICOM_VTBL(ds3db->iks) = &iksvt;
+
 		return S_OK;
 	}
 #else
@@ -2067,7 +2160,7 @@
 		(*ippdsb)->ds3db = ds3db;
 
 		ds3db->dsb = (*ippdsb);
-		IDirectSoundBufferImpl_AddRef((LPDIRECTSOUNDBUFFER)ippdsb);
+		IDirectSoundBufferImpl_AddRef((LPDIRECTSOUNDBUFFER)(*ippdsb));
 
 		InitializeCriticalSection(&ds3db->lock);
 
@@ -2094,6 +2187,11 @@
 			ds3db->buflen = 0;
 			ds3db->ds3db.dwMode = DS3DMODE_DISABLE;
 		}
+		ds3db->iks = (IKsPropertySetImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(*(ds3db->iks)));
+		ds3db->iks->ref = 1;
+		ds3db->iks->ds3db = ds3db;
+		ICOM_VTBL(ds3db->iks) = &iksvt;
+
 	}
 #endif
 	return DS_OK;




More information about the wine-patches mailing list