Release 980601
[wine/multimedia.git] / ole / folders.c
bloba9fc717c6c6dac96fe9cb37b5c515cd6983634fc
1 /*
2 * Shell Folder stuff
4 * Copyright 1997 Marcus Meissner
5 */
7 #include <ctype.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include "ole.h"
11 #include "ole2.h"
12 #include "debug.h"
13 #include "compobj.h"
14 #include "interfaces.h"
15 #include "shlobj.h"
17 /******************************************************************************
18 * IEnumIDList implementation
21 static ULONG WINAPI IEnumIDList_AddRef(LPENUMIDLIST this) {
22 TRACE(ole,"(%p)->()\n",this);
23 return ++(this->ref);
26 static ULONG WINAPI IEnumIDList_Release(LPENUMIDLIST this) {
27 TRACE(ole,"(%p)->()\n",this);
28 if (!--(this->ref)) {
29 WARN(ole," freeing IEnumIDList(%p)\n",this);
30 HeapFree(GetProcessHeap(),0,this);
31 return 0;
33 return this->ref;
36 static HRESULT WINAPI IEnumIDList_Next(
37 LPENUMIDLIST this,ULONG celt,LPITEMIDLIST *rgelt,ULONG *pceltFetched
38 ) {
39 FIXME(ole,"(%p)->(%ld,%p,%p),stub!\n",
40 this,celt,rgelt,pceltFetched
42 *pceltFetched = 0; /* we don't have any ... */
43 return 0;
46 static IEnumIDList_VTable eidlvt = {
47 (void *)1,
48 IEnumIDList_AddRef,
49 IEnumIDList_Release,
50 IEnumIDList_Next,
51 (void *)5,
52 (void *)6,
53 (void *)7
56 LPENUMIDLIST IEnumIDList_Constructor() {
57 LPENUMIDLIST lpeidl;
59 lpeidl= (LPENUMIDLIST)HeapAlloc(GetProcessHeap(),0,sizeof(IEnumIDList));
60 lpeidl->ref = 1;
61 lpeidl->lpvtbl = &eidlvt;
62 return lpeidl;
65 /******************************************************************************
66 * IShellFolder implementation
68 static ULONG WINAPI IShellFolder_Release(LPSHELLFOLDER this) {
69 TRACE(ole,"(%p)->()\n",this);
70 if (!--(this->ref)) {
71 WARN(ole," freeing IShellFolder(%p)\n",this);
72 HeapFree(GetProcessHeap(),0,this);
73 return 0;
75 return this->ref;
78 static ULONG WINAPI IShellFolder_AddRef(LPSHELLFOLDER this) {
79 TRACE(ole,"(%p)->()\n",this);
80 return ++(this->ref);
83 static HRESULT WINAPI IShellFolder_GetAttributesOf(
84 LPSHELLFOLDER this,UINT32 cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut
85 ) {
86 FIXME(ole,"(%p)->(%d,%p,%p),stub!\n",
87 this,cidl,apidl,rgfInOut
89 return 0;
92 static HRESULT WINAPI IShellFolder_BindToObject(
93 LPSHELLFOLDER this,LPCITEMIDLIST pidl,LPBC pbcReserved,REFIID riid,LPVOID * ppvOut
94 ) {
95 char xclsid[50];
97 WINE_StringFromCLSID(riid,xclsid);
98 FIXME(ole,"(%p)->(%p,%p,%s,%p),stub!\n",
99 this,pidl,pbcReserved,xclsid,ppvOut
101 *ppvOut = IShellFolder_Constructor();
102 return 0;
105 static HRESULT WINAPI IShellFolder_ParseDisplayName(
106 LPSHELLFOLDER this,HWND32 hwndOwner,LPBC pbcReserved,
107 LPOLESTR32 lpszDisplayName,DWORD *pchEaten,LPITEMIDLIST *ppidl,
108 DWORD *pdwAttributes
110 FIXME(ole,"(%p)->(%08x,%p,%p,%p,%p,%p),stub!\n",
111 this,hwndOwner,pbcReserved,lpszDisplayName,pchEaten,ppidl,pdwAttributes
113 if (pbcReserved)
114 *(DWORD*)pbcReserved = 0;
115 return 0;
118 static HRESULT WINAPI IShellFolder_EnumObjects(
119 LPSHELLFOLDER this,HWND32 hwndOwner,DWORD grfFlags,
120 LPENUMIDLIST* ppenumIDList
122 FIXME(ole,"(%p)->(0x%04x,0x%08lx,%p),stub!\n",
123 this,hwndOwner,grfFlags,ppenumIDList
125 *ppenumIDList = IEnumIDList_Constructor();
126 return 0;
129 static HRESULT WINAPI IShellFolder_CreateViewObject(
130 LPSHELLFOLDER this,HWND32 hwndOwner,REFIID riid,LPVOID *ppv
132 char xclsid[50];
134 WINE_StringFromCLSID(riid,xclsid);
135 FIXME(ole,"(%p)->(0x%04x,%s,%p),stub!\n",
136 this,hwndOwner,xclsid,ppv
138 *(DWORD*)ppv = 0;
139 return 0;
143 static struct IShellFolder_VTable sfvt = {
144 (void *)1,
145 IShellFolder_AddRef,
146 IShellFolder_Release,
147 IShellFolder_ParseDisplayName,
148 IShellFolder_EnumObjects,
149 IShellFolder_BindToObject,
150 (void *)7,
151 (void *)8,
152 IShellFolder_CreateViewObject,
153 IShellFolder_GetAttributesOf,
154 (void *)11,
155 (void *)12,
156 (void *)13
159 LPSHELLFOLDER IShellFolder_Constructor() {
160 LPSHELLFOLDER sf;
162 sf = (LPSHELLFOLDER)HeapAlloc(GetProcessHeap(),0,sizeof(IShellFolder));
163 sf->ref = 1;
164 sf->lpvtbl = &sfvt;
165 return sf;
168 static struct IShellLink_VTable slvt = {
169 (void *)1,
170 (void *)2,
171 (void *)3,
172 (void *)4,
173 (void *)5,
174 (void *)6,
175 (void *)7,
176 (void *)8,
177 (void *)9,
178 (void *)10,
179 (void *)11,
180 (void *)12,
181 (void *)13,
182 (void *)14,
183 (void *)15,
184 (void *)16,
185 (void *)17,
186 (void *)18,
187 (void *)19,
188 (void *)20,
189 (void *)21
192 LPSHELLLINK IShellLink_Constructor() {
193 LPSHELLLINK sl;
195 sl = (LPSHELLLINK)HeapAlloc(GetProcessHeap(),0,sizeof(IShellLink));
196 sl->ref = 1;
197 sl->lpvtbl = &slvt;
198 return sl;