1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_ICON_STORE_HEADER
#define _NULLSOFT_WINAMP_DEVICES_DEVICE_ICON_STORE_HEADER
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
#include "./ifc_deviceiconstore.h"
#include <vector>
class DeviceIconStore : public ifc_deviceiconstore
{
protected:
DeviceIconStore();
~DeviceIconStore();
public:
static HRESULT CreateInstance(DeviceIconStore **instance);
public:
/* Dispatchable */
size_t AddRef();
size_t Release();
int QueryInterface(GUID interface_guid, void **object);
/* ifc_deviceiconstore */
HRESULT Add(const wchar_t *path, unsigned int width, unsigned int height, BOOL replaceExisting);
HRESULT Remove(unsigned int width, unsigned int height);
HRESULT RemovePath(const wchar_t *path);
HRESULT RemoveAll();
HRESULT Get(wchar_t *buffer, size_t bufferMax, unsigned int width, unsigned int height);
HRESULT GetExact(wchar_t *buffer, size_t bufferMax, unsigned int width, unsigned int height);
HRESULT SetBasePath(const wchar_t *path);
HRESULT GetBasePath(wchar_t *buffer, size_t bufferMax);
HRESULT Clone(ifc_deviceiconstore **instance);
HRESULT Enumerate(EnumeratorCallback callback, void *user);
public:
void Lock();
void Unlock();
HRESULT GetFullPath(wchar_t *buffer, size_t bufferMax, const wchar_t *path);
protected:
typedef struct Record
{
unsigned int width;
unsigned int height;
wchar_t *path;
} Record;
typedef std::vector<Record> RecordList;
protected:
size_t ref;
wchar_t *base;
RecordList list;
CRITICAL_SECTION lock;
protected:
RECVS_DISPATCH;
};
#endif // _NULLSOFT_WINAMP_DEVICES_DEVICE_ICON_STORE_HEADER
|