Release 980301
[wine.git] / ole / folders.c
blob7903e899f1d7c1f869e5fb7d4e9c6060f85abc2b
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 fprintf(stderr,"IEnumIDList(%p)->AddRef()\n",this);
23 return ++(this->ref);
26 static ULONG WINAPI IEnumIDList_Release(LPENUMIDLIST this) {
27 fprintf(stderr,"IEnumIDList(%p)->Release()\n",this);
28 if (!--(this->ref)) {
29 fprintf(stderr," -> 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 fprintf(stderr,"IEnumIDList(%p)->Next(%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 fprintf(stderr,"IShellFolder(%p)->Release()\n",this);
70 if (!--(this->ref)) {
71 fprintf(stderr," -> 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 fprintf(stderr,"IShellFolder(%p)->AddRef()\n",this);
80 return ++(this->ref);
83 static HRESULT WINAPI IShellFolder_GetAttributesOf(
84 LPSHELLFOLDER this,UINT32 cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut
85 ) {
86 fprintf(stderr,"IShellFolder(%p)->GetAttributesOf(%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 fprintf(stderr,"IShellFolder(%p)->BindToObject(%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 fprintf(stderr,"IShellFolder(%p)->ParseDisplayName(%08x,%p,%p,%p,%p,%p),stub!\n",
111 this,hwndOwner,pbcReserved,lpszDisplayName,pchEaten,ppidl,pdwAttributes
113 *(DWORD*)pbcReserved = 0;
114 return 0;
117 static HRESULT WINAPI IShellFolder_EnumObjects(
118 LPSHELLFOLDER this,HWND32 hwndOwner,DWORD grfFlags,
119 LPENUMIDLIST* ppenumIDList
121 fprintf(stderr,"IShellFolder(%p)->EnumObjects(0x%04x,0x%08lx,%p),stub!\n",
122 this,hwndOwner,grfFlags,ppenumIDList
124 *ppenumIDList = IEnumIDList_Constructor();
125 return 0;
128 static HRESULT WINAPI IShellFolder_CreateViewObject(
129 LPSHELLFOLDER this,HWND32 hwndOwner,REFIID riid,LPVOID *ppv
131 char xclsid[50];
133 WINE_StringFromCLSID(riid,xclsid);
134 fprintf(stderr,"IShellFolder(%p)->CreateViewObject(0x%04x,%s,%p),stub!\n",
135 this,hwndOwner,xclsid,ppv
137 *(DWORD*)ppv = 0;
138 return 0;
142 static struct IShellFolder_VTable sfvt = {
143 (void *)1,
144 IShellFolder_AddRef,
145 IShellFolder_Release,
146 IShellFolder_ParseDisplayName,
147 IShellFolder_EnumObjects,
148 IShellFolder_BindToObject,
149 (void *)7,
150 (void *)8,
151 IShellFolder_CreateViewObject,
152 IShellFolder_GetAttributesOf,
153 (void *)11,
154 (void *)12,
155 (void *)13
158 LPSHELLFOLDER IShellFolder_Constructor() {
159 LPSHELLFOLDER sf;
161 sf = (LPSHELLFOLDER)HeapAlloc(GetProcessHeap(),0,sizeof(IShellFolder));
162 sf->ref = 1;
163 sf->lpvtbl = &sfvt;
164 return sf;
167 static struct IShellLink_VTable slvt = {
168 (void *)1,
169 (void *)2,
170 (void *)3,
171 (void *)4,
172 (void *)5,
173 (void *)6,
174 (void *)7,
175 (void *)8,
176 (void *)9,
177 (void *)10,
178 (void *)11,
179 (void *)12,
180 (void *)13,
181 (void *)14,
182 (void *)15,
183 (void *)16,
184 (void *)17,
185 (void *)18,
186 (void *)19,
187 (void *)20,
188 (void *)21
191 LPSHELLLINK IShellLink_Constructor() {
192 LPSHELLLINK sl;
194 sl = (LPSHELLLINK)HeapAlloc(GetProcessHeap(),0,sizeof(IShellLink));
195 sl->ref = 1;
196 sl->lpvtbl = &slvt;
197 return sl;