imagehlp: Use the IMAGE_FIRST_SECTION helper macro.
[wine.git] / dlls / dmime / segmentstate.c
blob1a0b63419f09e21d9cee6868f17bf782138f84e2
1 /* IDirectMusicSegmentState8 Implementation
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "dmime_private.h"
21 #include "dmobject.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
25 typedef struct IDirectMusicSegmentState8Impl {
26 IDirectMusicSegmentState8 IDirectMusicSegmentState8_iface;
27 LONG ref;
28 } IDirectMusicSegmentState8Impl;
30 static inline IDirectMusicSegmentState8Impl *impl_from_IDirectMusicSegmentState8(IDirectMusicSegmentState8 *iface)
32 return CONTAINING_RECORD(iface, IDirectMusicSegmentState8Impl, IDirectMusicSegmentState8_iface);
35 static HRESULT WINAPI DirectMusicSegmentState8_QueryInterface(IDirectMusicSegmentState8 *iface, REFIID riid, void **ppobj)
37 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
39 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
41 if (!ppobj)
42 return E_POINTER;
44 *ppobj = NULL;
46 if (IsEqualIID(riid, &IID_IUnknown) ||
47 IsEqualIID(riid, &IID_IDirectMusicSegmentState) ||
48 IsEqualIID(riid, &IID_IDirectMusicSegmentState8))
50 IDirectMusicSegmentState8_AddRef(iface);
51 *ppobj = &This->IDirectMusicSegmentState8_iface;
52 return S_OK;
55 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
56 return E_NOINTERFACE;
59 static ULONG WINAPI DirectMusicSegmentState8_AddRef(IDirectMusicSegmentState8 *iface)
61 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
62 ULONG ref = InterlockedIncrement(&This->ref);
64 TRACE("(%p): %ld\n", This, ref);
66 return ref;
69 static ULONG WINAPI DirectMusicSegmentState8_Release(IDirectMusicSegmentState8 *iface)
71 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
72 ULONG ref = InterlockedDecrement(&This->ref);
74 TRACE("(%p): %ld\n", This, ref);
76 if (!ref) free(This);
78 return ref;
81 static HRESULT WINAPI DirectMusicSegmentState8_GetRepeats(IDirectMusicSegmentState8 *iface, DWORD* pdwRepeats)
83 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
84 FIXME("(%p, %p): stub\n", This, pdwRepeats);
85 return S_OK;
88 static HRESULT WINAPI DirectMusicSegmentState8_GetSegment(IDirectMusicSegmentState8 *iface, IDirectMusicSegment** ppSegment)
90 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
91 FIXME("(%p, %p): stub\n", This, ppSegment);
92 return S_OK;
95 static HRESULT WINAPI DirectMusicSegmentState8_GetStartTime(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtStart)
97 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
98 FIXME("(%p, %p): stub\n", This, pmtStart);
99 return S_OK;
102 static HRESULT WINAPI DirectMusicSegmentState8_GetSeek(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtSeek)
104 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
105 FIXME("(%p, %p): stub\n", This, pmtSeek);
106 return S_OK;
109 static HRESULT WINAPI DirectMusicSegmentState8_GetStartPoint(IDirectMusicSegmentState8 *iface, MUSIC_TIME* pmtStart)
111 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
112 FIXME("(%p, %p): stub\n", This, pmtStart);
113 return S_OK;
116 static HRESULT WINAPI DirectMusicSegmentState8_SetTrackConfig(IDirectMusicSegmentState8 *iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff) {
117 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
118 FIXME("(%p, %s, %ld, %ld, %ld, %ld): stub\n", This, debugstr_dmguid(rguidTrackClassID), dwGroupBits, dwIndex, dwFlagsOn, dwFlagsOff);
119 return S_OK;
122 static HRESULT WINAPI DirectMusicSegmentState8_GetObjectInPath(IDirectMusicSegmentState8 *iface, DWORD dwPChannel, DWORD dwStage, DWORD dwBuffer, REFGUID guidObject, DWORD dwIndex, REFGUID iidInterface, void** ppObject) {
123 IDirectMusicSegmentState8Impl *This = impl_from_IDirectMusicSegmentState8(iface);
124 FIXME("(%p, %ld, %ld, %ld, %s, %ld, %s, %p): stub\n", This, dwPChannel, dwStage, dwBuffer, debugstr_dmguid(guidObject), dwIndex, debugstr_dmguid(iidInterface), ppObject);
125 return S_OK;
128 static const IDirectMusicSegmentState8Vtbl DirectMusicSegmentState8Vtbl = {
129 DirectMusicSegmentState8_QueryInterface,
130 DirectMusicSegmentState8_AddRef,
131 DirectMusicSegmentState8_Release,
132 DirectMusicSegmentState8_GetRepeats,
133 DirectMusicSegmentState8_GetSegment,
134 DirectMusicSegmentState8_GetStartTime,
135 DirectMusicSegmentState8_GetSeek,
136 DirectMusicSegmentState8_GetStartPoint,
137 DirectMusicSegmentState8_SetTrackConfig,
138 DirectMusicSegmentState8_GetObjectInPath
141 /* for ClassFactory */
142 HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface)
144 IDirectMusicSegmentState8Impl* obj;
145 HRESULT hr;
147 *ret_iface = NULL;
148 if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY;
149 obj->IDirectMusicSegmentState8_iface.lpVtbl = &DirectMusicSegmentState8Vtbl;
150 obj->ref = 1;
152 hr = IDirectMusicSegmentState8_QueryInterface(&obj->IDirectMusicSegmentState8_iface, riid, ret_iface);
153 IDirectMusicSegmentState8_Release(&obj->IDirectMusicSegmentState8_iface);
154 return hr;