Release 971221
[wine/multimedia.git] / ole / folders.c
blobcf0def5127d9e49147ec3144cb6ffabd9c29f50a
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 = {
49 IEnumIDList_AddRef,
50 IEnumIDList_Release,
51 IEnumIDList_Next,
52 5,6,7
55 LPENUMIDLIST IEnumIDList_Constructor() {
56 LPENUMIDLIST lpeidl;
58 lpeidl= (LPENUMIDLIST)HeapAlloc(GetProcessHeap(),0,sizeof(IEnumIDList));
59 lpeidl->ref = 1;
60 lpeidl->lpvtbl = &eidlvt;
61 return lpeidl;
64 /******************************************************************************
65 * IShellFolder implementation
67 static ULONG WINAPI IShellFolder_Release(LPSHELLFOLDER this) {
68 fprintf(stderr,"IShellFolder(%p)->Release()\n",this);
69 if (!--(this->ref)) {
70 fprintf(stderr," -> freeing IShellFolder(%p)\n",this);
71 HeapFree(GetProcessHeap(),0,this);
72 return 0;
74 return this->ref;
77 static ULONG WINAPI IShellFolder_AddRef(LPSHELLFOLDER this) {
78 fprintf(stderr,"IShellFolder(%p)->AddRef()\n",this);
79 return ++(this->ref);
82 static HRESULT WINAPI IShellFolder_GetAttributesOf(
83 LPSHELLFOLDER this,UINT32 cidl,LPCITEMIDLIST *apidl,DWORD *rgfInOut
84 ) {
85 fprintf(stderr,"IShellFolder(%p)->GetAttributesOf(%d,%p,%p),stub!\n",
86 this,cidl,apidl,rgfInOut
88 return 0;
91 static HRESULT WINAPI IShellFolder_BindToObject(
92 LPSHELLFOLDER this,LPCITEMIDLIST pidl,LPBC pbcReserved,REFIID riid,LPVOID * ppvOut
93 ) {
94 char xclsid[50];
96 StringFromCLSID(riid,xclsid);
97 fprintf(stderr,"IShellFolder(%p)->BindToObject(%p,%p,%s,%p),stub!\n",
98 this,pidl,pbcReserved,xclsid,ppvOut
100 *ppvOut = IShellFolder_Constructor();
101 return 0;
104 static HRESULT WINAPI IShellFolder_ParseDisplayName(
105 LPSHELLFOLDER this,HWND32 hwndOwner,LPBC pbcReserved,
106 LPOLESTR lpszDisplayName,DWORD *pchEaten,LPITEMIDLIST *ppidl,
107 DWORD *pdwAttributes
109 fprintf(stderr,"IShellFolder(%p)->ParseDisplayName(%08x,%p,%s,%p,%p,%p),stub!\n",
110 this,hwndOwner,pbcReserved,lpszDisplayName,pchEaten,ppidl,pdwAttributes
112 *(DWORD*)pbcReserved = NULL;
113 return 0;
116 static HRESULT WINAPI IShellFolder_EnumObjects(
117 LPSHELLFOLDER this,HWND32 hwndOwner,DWORD grfFlags,
118 LPENUMIDLIST* ppenumIDList
120 fprintf(stderr,"IShellFolder(%p)->EnumObjects(0x%04x,0x%08lx,%p),stub!\n",
121 this,hwndOwner,grfFlags,ppenumIDList
123 *ppenumIDList = IEnumIDList_Constructor();
124 return 0;
127 static HRESULT WINAPI IShellFolder_CreateViewObject(
128 LPSHELLFOLDER this,HWND32 hwndOwner,REFIID riid,LPVOID *ppv
130 char xclsid[50];
132 StringFromCLSID(riid,xclsid);
133 fprintf(stderr,"IShellFolder(%p)->CreateViewObject(0x%04x,%s,%p),stub!\n",
134 this,hwndOwner,xclsid,ppv
136 *(DWORD*)ppv = NULL;
137 return 0;
141 static struct IShellFolder_VTable sfvt = {
143 IShellFolder_AddRef,
144 IShellFolder_Release,
145 IShellFolder_ParseDisplayName,
146 IShellFolder_EnumObjects,
147 IShellFolder_BindToObject,
148 7,8,
149 IShellFolder_CreateViewObject,
150 IShellFolder_GetAttributesOf,
151 11,12,13
154 LPSHELLFOLDER IShellFolder_Constructor() {
155 LPSHELLFOLDER sf;
157 sf = (LPSHELLFOLDER)HeapAlloc(GetProcessHeap(),0,sizeof(IShellFolder));
158 sf->ref = 1;
159 sf->lpvtbl = &sfvt;
160 return sf;
163 static struct IShellLink_VTable slvt = {
164 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21
167 LPSHELLLINK IShellLink_Constructor() {
168 LPSHELLLINK sl;
170 sl = (LPSHELLLINK)HeapAlloc(GetProcessHeap(),0,sizeof(IShellLink));
171 sl->ref = 1;
172 sl->lpvtbl = &slvt;
173 return sl;