~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/shell32/shlfsbind.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * File System Bind Data object to use as parameter for the bind context to
  3  * IShellFolder_ParseDisplayName
  4  *
  5  * Copyright 2003 Rolf Kalbermatter
  6  *
  7  * This library is free software; you can redistribute it and/or
  8  * modify it under the terms of the GNU Lesser General Public
  9  * License as published by the Free Software Foundation; either
 10  * version 2.1 of the License, or (at your option) any later version.
 11  *
 12  * This library is distributed in the hope that it will be useful,
 13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 15  * Lesser General Public License for more details.
 16  *
 17  * You should have received a copy of the GNU Lesser General Public
 18  * License along with this library; if not, write to the Free Software
 19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 20  *
 21  */
 22 #include "config.h"
 23 #include "wine/port.h"
 24 
 25 #include <stdarg.h>
 26 
 27 #define COBJMACROS
 28 
 29 #include "windef.h"
 30 #include "winbase.h"
 31 #include "winuser.h"
 32 #include "shlobj.h"
 33 #include "shell32_main.h"
 34 
 35 #include "wine/debug.h"
 36 
 37 WINE_DEFAULT_DEBUG_CHANNEL(pidl);
 38 
 39 /***********************************************************************
 40  * IFileSystemBindData implementation
 41  */
 42 typedef struct
 43 {
 44     const IFileSystemBindDataVtbl *lpVtbl;
 45     LONG              ref;
 46     WIN32_FIND_DATAW findFile;
 47 } IFileSystemBindDataImpl;
 48 
 49 static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(IFileSystemBindData *, REFIID, LPVOID*);
 50 static ULONG WINAPI IFileSystemBindData_fnAddRef(IFileSystemBindData *);
 51 static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *);
 52 static HRESULT WINAPI IFileSystemBindData_fnGetFindData(IFileSystemBindData *, WIN32_FIND_DATAW *);
 53 static HRESULT WINAPI IFileSystemBindData_fnSetFindData(IFileSystemBindData *, const WIN32_FIND_DATAW *);
 54 
 55 static const IFileSystemBindDataVtbl sbvt =
 56 {
 57     IFileSystemBindData_fnQueryInterface,
 58     IFileSystemBindData_fnAddRef,
 59     IFileSystemBindData_fnRelease,
 60     IFileSystemBindData_fnSetFindData,
 61     IFileSystemBindData_fnGetFindData,
 62 };
 63 
 64 static const WCHAR wFileSystemBindData[] = {
 65     'F','i','l','e',' ','S','y','s','t','e','m',' ','B','i','n','d','D','a','t','a',0};
 66 
 67 HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
 68 {
 69     IFileSystemBindDataImpl *sb;
 70     HRESULT ret = E_OUTOFMEMORY;
 71 
 72     TRACE("%p, %p\n", pfd, ppV);
 73 
 74     if (!ppV)
 75        return E_INVALIDARG;
 76 
 77     *ppV = NULL;
 78 
 79     sb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IFileSystemBindDataImpl));
 80     if (!sb)
 81         return ret;
 82 
 83     sb->lpVtbl = &sbvt;
 84     sb->ref = 1;
 85     IFileSystemBindData_fnSetFindData((IFileSystemBindData*)sb, pfd);
 86 
 87     ret = CreateBindCtx(0, ppV);
 88     if (SUCCEEDED(ret))
 89     {
 90         BIND_OPTS bindOpts;
 91 
 92         bindOpts.cbStruct = sizeof(BIND_OPTS);
 93         bindOpts.grfFlags = 0;
 94         bindOpts.grfMode = STGM_CREATE;
 95         bindOpts.dwTickCountDeadline = 0;
 96         IBindCtx_SetBindOptions(*ppV, &bindOpts);
 97         IBindCtx_RegisterObjectParam(*ppV, (LPOLESTR)wFileSystemBindData, (LPUNKNOWN)sb);
 98 
 99         IFileSystemBindData_Release((IFileSystemBindData*)sb);
100     }
101     else
102         HeapFree(GetProcessHeap(), 0, sb);
103     return ret;
104 }
105 
106 static HRESULT WINAPI IFileSystemBindData_fnQueryInterface(
107                 IFileSystemBindData *iface, REFIID riid, LPVOID *ppV)
108 {
109     IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
110     TRACE("(%p)->(\n\tIID:\t%s, %p)\n", This, debugstr_guid(riid), ppV);
111 
112     *ppV = NULL;
113 
114     if (IsEqualIID(riid, &IID_IUnknown))
115         *ppV = This;
116     else if (IsEqualIID(riid, &IID_IFileSystemBindData))
117         *ppV = (IFileSystemBindData*)This;
118 
119     if (*ppV)
120     {
121         IUnknown_AddRef((IUnknown*)(*ppV));
122         TRACE("-- Interface: (%p)->(%p)\n", ppV, *ppV);
123         return S_OK;
124     }
125     TRACE("-- Interface: E_NOINTERFACE\n");
126     return E_NOINTERFACE;
127 }
128 
129 static ULONG WINAPI IFileSystemBindData_fnAddRef(IFileSystemBindData *iface)
130 {
131     IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
132     ULONG refCount = InterlockedIncrement(&This->ref);
133 
134     TRACE("(%p)->(count=%i)\n", This, refCount - 1);
135 
136     return refCount;
137 }
138 
139 static ULONG WINAPI IFileSystemBindData_fnRelease(IFileSystemBindData *iface)
140 {
141     IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
142     ULONG refCount = InterlockedDecrement(&This->ref);
143     
144     TRACE("(%p)->(count=%i)\n", This, refCount + 1);
145 
146     if (!refCount)
147     {
148         TRACE(" destroying ISFBindPidl(%p)\n",This);
149         HeapFree(GetProcessHeap(), 0, This);
150     }
151     return refCount;
152 }
153 
154 static HRESULT WINAPI IFileSystemBindData_fnGetFindData(
155                IFileSystemBindData *iface, WIN32_FIND_DATAW *pfd)
156 {
157     IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
158     TRACE("(%p), %p\n", This, pfd);
159 
160     if (!pfd)
161         return E_INVALIDARG;
162 
163     *pfd = This->findFile;
164     return NOERROR;
165 }
166 
167 static HRESULT WINAPI IFileSystemBindData_fnSetFindData(
168                IFileSystemBindData *iface, const WIN32_FIND_DATAW *pfd)
169 {
170     IFileSystemBindDataImpl *This = (IFileSystemBindDataImpl *)iface;
171     TRACE("(%p), %p\n", This, pfd);
172 
173     if (pfd)
174         This->findFile = *pfd;
175     else
176         memset(&This->findFile, 0, sizeof(WIN32_FIND_DATAW));
177     return NOERROR;
178 }
179 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.