ReactOS 0.4.17-dev-970-gcf0f1a6
download.c File Reference
#include "dmusic_private.h"
Include dependency graph for download.c:

Go to the source code of this file.

Classes

struct  download
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dmusic)
 
 C_ASSERT (sizeof(struct download)==offsetof(struct download, data[0]))
 
static struct download * impl_from_IDirectMusicDownload (IDirectMusicDownload *iface)
 
static HRESULT WINAPI download_QueryInterface (IDirectMusicDownload *iface, REFIID riid, void **ret_iface)
 
static ULONG WINAPI download_AddRef (IDirectMusicDownload *iface)
 
static ULONG WINAPI download_Release (IDirectMusicDownload *iface)
 
static HRESULT WINAPI download_GetBuffer (IDirectMusicDownload *iface, void **buffer, DWORD *size)
 
HRESULT download_create (DWORD size, IDirectMusicDownload **ret_iface)
 

Variables

static const IDirectMusicDownloadVtbl download_vtbl
 

Function Documentation

◆ C_ASSERT()

C_ASSERT ( sizeof(struct download)  = =offsetof(struct download, data[0]))

◆ download_AddRef()

static ULONG WINAPI download_AddRef ( IDirectMusicDownload *  iface)
static

Definition at line 62 of file download.c.

63{
66
67 TRACE("(%p): new ref = %lu\n", iface, ref);
68
69 return ref;
70}
#define InterlockedIncrement
Definition: armddk.h:53
static struct download * impl_from_IDirectMusicDownload(IDirectMusicDownload *iface)
Definition: download.c:40
#define TRACE(s)
Definition: solgame.cpp:4
LONG ref
Definition: download.c:28
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ download_create()

HRESULT download_create ( DWORD  size,
IDirectMusicDownload **  ret_iface 
)

Definition at line 106 of file download.c.

107{
108 struct download *download;
109
110 *ret_iface = NULL;
111 if (!(download = malloc(offsetof(struct download, data[size])))) return E_OUTOFMEMORY;
113 download->ref = 1;
114 download->size = size;
115
116 TRACE("Created DirectMusicDownload %p\n", download);
118 return S_OK;
119}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define malloc
Definition: debug_ros.c:4
static const IDirectMusicDownloadVtbl download_vtbl
Definition: download.c:98
#define NULL
Definition: types.h:112
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
#define S_OK
Definition: intsafe.h:52
#define offsetof(TYPE, MEMBER)
IDirectMusicDownload IDirectMusicDownload_iface
Definition: download.c:27
DWORD size
Definition: download.c:30

Referenced by synth_port_download_AllocateBuffer().

◆ download_GetBuffer()

static HRESULT WINAPI download_GetBuffer ( IDirectMusicDownload *  iface,
void **  buffer,
DWORD *  size 
)
static

Definition at line 86 of file download.c.

87{
89
90 TRACE("(%p, %p, %p)\n", iface, buffer, size);
91
92 *buffer = This->data;
93 *size = This->size;
94
95 return S_OK;
96}
GLuint buffer
Definition: glext.h:5915

◆ download_QueryInterface()

static HRESULT WINAPI download_QueryInterface ( IDirectMusicDownload *  iface,
REFIID  riid,
void **  ret_iface 
)
static

Definition at line 45 of file download.c.

46{
47 TRACE("(%p, %s, %p)\n", iface, debugstr_dmguid(riid), ret_iface);
48
50 IsEqualIID(riid, &IID_IDirectMusicDownload))
51 {
53 *ret_iface = iface;
54 return S_OK;
55 }
56
57 *ret_iface = NULL;
58 WARN("(%p, %s, %p): not found\n", iface, debugstr_dmguid(riid), ret_iface);
59 return E_NOINTERFACE;
60}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
const char * debugstr_dmguid(const GUID *id)
Definition: dmobject.c:36
#define IDirectMusicDownload_AddRef(p)
Definition: dmusicc.h:603
REFIID riid
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ download_Release()

static ULONG WINAPI download_Release ( IDirectMusicDownload *  iface)
static

Definition at line 72 of file download.c.

73{
76
77 TRACE("(%p): new ref = %lu\n", iface, ref);
78
79 if (!ref) {
80 free(This);
81 }
82
83 return ref;
84}
#define InterlockedDecrement
Definition: armddk.h:52
#define free
Definition: debug_ros.c:5

◆ impl_from_IDirectMusicDownload()

static struct download * impl_from_IDirectMusicDownload ( IDirectMusicDownload *  iface)
inlinestatic

Definition at line 40 of file download.c.

41{
42 return CONTAINING_RECORD(iface, struct download, IDirectMusicDownload_iface);
43}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by download_AddRef(), download_GetBuffer(), and download_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dmusic  )

Variable Documentation

◆ download_vtbl

const IDirectMusicDownloadVtbl download_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI download_AddRef(IDirectMusicDownload *iface)
Definition: download.c:62
static HRESULT WINAPI download_GetBuffer(IDirectMusicDownload *iface, void **buffer, DWORD *size)
Definition: download.c:86
static HRESULT WINAPI download_QueryInterface(IDirectMusicDownload *iface, REFIID riid, void **ret_iface)
Definition: download.c:45
static ULONG WINAPI download_Release(IDirectMusicDownload *iface)
Definition: download.c:72

Definition at line 98 of file download.c.

Referenced by download_create().