Release 980104
[wine/multimedia.git] / ole / folders.c
blob45d54662f71d27ecf6169eabb9b9a44007f53be7
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 "stddebug.h"
13 #include "debug.h"
14 #include "compobj.h"
15 #include "interfaces.h"
16 #include "shlobj.h"
18 /******************************************************************************
19 * IEnumIDList implementation
22 static ULONG WINAPI IEnumIDList_AddRef(LPENUMIDLIST this) {
23 fprintf(stderr,"IEnumIDList(%p)->AddRef()\n",this);
24 return ++(this->ref);
27 static ULONG WINAPI IEnumIDList_Release(LPENUMIDLIST this) {
28 fprintf(stderr,"IEnumIDList(%p)->Release()\n",this);
29 if (!--(this->ref)) {
30 fprintf(stderr," -> freeing IEnumIDList(%p)\n",this);
31 HeapFree(GetProcessHeap(),0,this);
32 return 0;
34 return this->ref;
37 static HRESULT WINAPI IEnumIDList_Next(
38 LPENUMIDLIST this,ULONG celt,LPITEMIDLIST *rgelt,ULONG *pceltFetched
39 ) {
40 fprintf(stderr,"IEnumIDList(%p)->Next(%ld,%p,%p),stub!\n",
41 this,celt,rgelt,pceltFetched
43 *pceltFetched = 0; /* we don't have any ... */
44 return 0;
47 static IEnumIDList_VTable eidlvt = {
48 (void *)1,
49 IEnumIDList_AddRef,
50 IEnumIDList_Release,
51 IEnumIDList_Next,
52 (void *)5,
53 (void *)6,
54 (void *)7
57 LPENUMIDLIST IEnumIDList_Constructor() {
58 LPENUMIDLIST lpeidl;
60 lpeidl= (LPENUMIDLIST)HeapAlloc(GetProcessHeap(),0,sizeof(IEnumIDList));
61 lpeidl->ref = 1;
62 lpeidl->lpvtbl = &eidlvt;
63 return lpeidl;
66 /******************************************************************************
67 * IShellFolder implementation
69 static ULONG WINAPI IShellFolder_Release(LPSHELLFOLDER this) {
70 fprintf(stderr,"IShellFolder(%p)->Release()\n",this);
71 if (!--(this->ref)) {
72 fprintf(stderr," -> freeing IShellFolder(%p)\n",this);
73 HeapFree(GetProcessHeap(),0,this);
74 return 0;
76 return this->ref;
79 static ULONG WINAPI IShellFolder_AddRef(LPSHELLFOLDER this) {
80 fprintf(stderr,"IShellFolder(%p)->AddRef()\n",this);
81 return ++(this->ref);
84 static HRESULT WINAPI IShellFolder_GetAttributesOf(
85 LPSHELLFOLDER this,UINT32 cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut
86 ) {
87 fprintf(stderr,"IShellFolder(%p)->GetAttributesOf(%d,%p,%p),stub!\n",
88 this,cidl,apidl,rgfInOut
90 return 0;
93 static HRESULT WINAPI IShellFolder_BindToObject(
94 LPSHELLFOLDER this,LPCITEMIDLIST pidl,LPBC pbcReserved,REFIID riid,LPVOID * ppvOut
95 ) {
96 char xclsid[50];
98 StringFromCLSID(riid,xclsid);
99 fprintf(stderr,"IShellFolder(%p)->BindToObject(%p,%p,%s,%p),stub!\n",
100 this,pidl,pbcReserved,xclsid,ppvOut
102 *ppvOut = IShellFolder_Constructor();
103 return 0;
106 static HRESULT WINAPI IShellFolder_ParseDisplayName(
107 LPSHELLFOLDER this,HWND32 hwndOwner,LPBC pbcReserved,
108 LPOLESTR lpszDisplayName,DWORD *pchEaten,LPITEMIDLIST *ppidl,
109 DWORD *pdwAttributes
111 fprintf(stderr,"IShellFolder(%p)->ParseDisplayName(%08x,%p,%s,%p,%p,%p),stub!\n",
112 this,hwndOwner,pbcReserved,lpszDisplayName,pchEaten,ppidl,pdwAttributes
114 *(DWORD*)pbcReserved = 0;
115 return 0;
118 static HRESULT WINAPI IShellFolder_EnumObjects(
119 LPSHELLFOLDER this,HWND32 hwndOwner,DWORD grfFlags,
120 LPENUMIDLIST* ppenumIDList
122 fprintf(stderr,"IShellFolder(%p)->EnumObjects(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 StringFromCLSID(riid,xclsid);
135 fprintf(stderr,"IShellFolder(%p)->CreateViewObject(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;