ReactOS  0.4.13-dev-92-gf251225
storage.c
Go to the documentation of this file.
1 /*
2  * ITSS Storage implementation
3  *
4  * Copyright 2004 Mike McCormack
5  *
6  * see http://bonedaddy.net/pabs3/hhm/#chmspec
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22 
23 #include "config.h"
24 
25 #include <stdarg.h>
26 #include <stdio.h>
27 
28 #define COBJMACROS
29 
30 #include "windef.h"
31 #include "winbase.h"
32 #include "winuser.h"
33 #include "ole2.h"
34 
35 #include "chm_lib.h"
36 #include "itsstor.h"
37 
38 #include "wine/itss.h"
39 #include "wine/unicode.h"
40 #include "wine/debug.h"
41 
43 
44 /************************************************************************/
45 
46 typedef struct _ITSS_IStorageImpl
47 {
50  struct chmFile *chmfile;
51  WCHAR dir[1];
53 
54 struct enum_info
55 {
56  struct enum_info *next, *prev;
57  struct chmUnitInfo ui;
58 };
59 
60 typedef struct _IEnumSTATSTG_Impl
61 {
64  struct enum_info *first, *last, *current;
66 
67 typedef struct _IStream_Impl
68 {
73  struct chmUnitInfo ui;
74 } IStream_Impl;
75 
77 {
78  return CONTAINING_RECORD(iface, ITSS_IStorageImpl, IStorage_iface);
79 }
80 
82 {
83  return CONTAINING_RECORD(iface, IEnumSTATSTG_Impl, IEnumSTATSTG_iface);
84 }
85 
86 static inline IStream_Impl *impl_from_IStream(IStream *iface)
87 {
88  return CONTAINING_RECORD(iface, IStream_Impl, IStream_iface);
89 }
90 
92  struct chmFile *chmfile, const WCHAR *dir, IStorage** ppstgOpen );
94  ITSS_IStorageImpl *stg, struct chmUnitInfo *ui );
95 
96 /************************************************************************/
97 
99  IEnumSTATSTG* iface,
100  REFIID riid,
101  void** ppvObject)
102 {
104 
107  {
108  IEnumSTATSTG_AddRef(iface);
109  *ppvObject = &This->IEnumSTATSTG_iface;
110  return S_OK;
111  }
112 
113  WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
114  return E_NOINTERFACE;
115 }
116 
118  IEnumSTATSTG* iface)
119 {
121  return InterlockedIncrement(&This->ref);
122 }
123 
125  IEnumSTATSTG* iface)
126 {
128 
130 
131  if (ref == 0)
132  {
133  while( This->first )
134  {
135  struct enum_info *t = This->first->next;
136  HeapFree( GetProcessHeap(), 0, This->first );
137  This->first = t;
138  }
141  }
142 
143  return ref;
144 }
145 
147  IEnumSTATSTG* iface,
148  ULONG celt,
149  STATSTG* rgelt,
150  ULONG* pceltFetched)
151 {
153  DWORD len, n;
154  struct enum_info *cur;
155 
156  TRACE("%p %u %p %p\n", This, celt, rgelt, pceltFetched );
157 
158  cur = This->current;
159  n = 0;
160  while( (n<celt) && cur)
161  {
162  WCHAR *str;
163 
164  memset( rgelt, 0, sizeof *rgelt );
165 
166  /* copy the name */
167  str = cur->ui.path;
168  if( *str == '/' )
169  str++;
170  len = strlenW( str ) + 1;
171  rgelt->pwcsName = CoTaskMemAlloc( len*sizeof(WCHAR) );
172  strcpyW( rgelt->pwcsName, str );
173 
174  /* determine the type */
175  if( rgelt->pwcsName[len-2] == '/' )
176  {
177  rgelt->pwcsName[len-2] = 0;
178  rgelt->type = STGTY_STORAGE;
179  }
180  else
181  rgelt->type = STGTY_STREAM;
182 
183  /* copy the size */
184  rgelt->cbSize.QuadPart = cur->ui.length;
185 
186  /* advance to the next item if it exists */
187  n++;
188  cur = cur->next;
189  }
190 
191  This->current = cur;
192  *pceltFetched = n;
193 
194  if( n < celt )
195  return S_FALSE;
196 
197  return S_OK;
198 }
199 
201  IEnumSTATSTG* iface,
202  ULONG celt)
203 {
205  DWORD n;
206  struct enum_info *cur;
207 
208  TRACE("%p %u\n", This, celt );
209 
210  cur = This->current;
211  n = 0;
212  while( (n<celt) && cur)
213  {
214  n++;
215  cur = cur->next;
216  }
217  This->current = cur;
218 
219  if( n < celt )
220  return S_FALSE;
221 
222  return S_OK;
223 }
224 
226  IEnumSTATSTG* iface)
227 {
229 
230  TRACE("%p\n", This );
231 
232  This->current = This->first;
233 
234  return S_OK;
235 }
236 
238  IEnumSTATSTG* iface,
239  IEnumSTATSTG** ppenum)
240 {
241  FIXME("\n");
242  return E_NOTIMPL;
243 }
244 
245 static const IEnumSTATSTGVtbl IEnumSTATSTG_vtbl =
246 {
254 };
255 
257 {
258  IEnumSTATSTG_Impl *stgenum;
259 
260  stgenum = HeapAlloc( GetProcessHeap(), 0, sizeof (IEnumSTATSTG_Impl) );
261  stgenum->IEnumSTATSTG_iface.lpVtbl = &IEnumSTATSTG_vtbl;
262  stgenum->ref = 1;
263  stgenum->first = NULL;
264  stgenum->last = NULL;
265  stgenum->current = NULL;
266 
267  ITSS_LockModule();
268  TRACE(" -> %p\n", stgenum );
269 
270  return stgenum;
271 }
272 
273 /************************************************************************/
274 
276  IStorage* iface,
277  REFIID riid,
278  void** ppvObject)
279 {
281 
283  || IsEqualGUID(riid, &IID_IStorage))
284  {
285  IStorage_AddRef(iface);
286  *ppvObject = &This->IStorage_iface;
287  return S_OK;
288  }
289 
290  WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
291  return E_NOINTERFACE;
292 }
293 
295  IStorage* iface)
296 {
298  return InterlockedIncrement(&This->ref);
299 }
300 
302  IStorage* iface)
303 {
305 
307 
308  if (ref == 0)
309  {
310  chm_close(This->chmfile);
313  }
314 
315  return ref;
316 }
317 
319  IStorage* iface,
320  LPCOLESTR pwcsName,
321  DWORD grfMode,
322  DWORD reserved1,
324  IStream** ppstm)
325 {
326  FIXME("\n");
327  return E_NOTIMPL;
328 }
329 
331  IStorage* iface,
332  LPCOLESTR pwcsName,
333  void* reserved1,
334  DWORD grfMode,
336  IStream** ppstm)
337 {
339  IStream_Impl *stm;
340  DWORD len;
341  struct chmUnitInfo ui;
342  int r;
343  WCHAR *path, *p;
344 
345  TRACE("%p %s %p %u %u %p\n", This, debugstr_w(pwcsName),
346  reserved1, grfMode, reserved2, ppstm );
347 
348  len = strlenW( This->dir ) + strlenW( pwcsName ) + 1;
349  path = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
350  strcpyW( path, This->dir );
351 
352  if( pwcsName[0] == '/' || pwcsName[0] == '\\' )
353  {
354  p = &path[strlenW( path ) - 1];
355  while( ( path <= p ) && ( *p == '/' ) )
356  *p-- = 0;
357  }
358  strcatW( path, pwcsName );
359 
360  for(p=path; *p; p++) {
361  if(*p == '\\')
362  *p = '/';
363  }
364 
365  if(*--p == '/')
366  *p = 0;
367 
368  TRACE("Resolving %s\n", debugstr_w(path));
369 
370  r = chm_resolve_object(This->chmfile, path, &ui);
371  HeapFree( GetProcessHeap(), 0, path );
372 
373  if( r != CHM_RESOLVE_SUCCESS ) {
374  WARN("Could not resolve object\n");
375  return STG_E_FILENOTFOUND;
376  }
377 
378  stm = ITSS_create_stream( This, &ui );
379  if( !stm )
380  return E_FAIL;
381 
382  *ppstm = &stm->IStream_iface;
383 
384  return S_OK;
385 }
386 
388  IStorage* iface,
389  LPCOLESTR pwcsName,
390  DWORD grfMode,
391  DWORD dwStgFmt,
393  IStorage** ppstg)
394 {
395  FIXME("\n");
396  return E_NOTIMPL;
397 }
398 
400  IStorage* iface,
401  LPCOLESTR pwcsName,
402  IStorage* pstgPriority,
403  DWORD grfMode,
404  SNB snbExclude,
405  DWORD reserved,
406  IStorage** ppstg)
407 {
409  struct chmFile *chmfile;
410  WCHAR *path, *p;
411  DWORD len;
412 
413  TRACE("%p %s %p %u %p %u %p\n", This, debugstr_w(pwcsName),
414  pstgPriority, grfMode, snbExclude, reserved, ppstg);
415 
416  chmfile = chm_dup( This->chmfile );
417  if( !chmfile )
418  return E_FAIL;
419 
420  len = strlenW( This->dir ) + strlenW( pwcsName ) + 2; /* need room for a terminating slash */
421  path = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
422  strcpyW( path, This->dir );
423 
424  if( pwcsName[0] == '/' || pwcsName[0] == '\\' )
425  {
426  p = &path[strlenW( path ) - 1];
427  while( ( path <= p ) && ( *p == '/' ) )
428  *p-- = 0;
429  }
430  strcatW( path, pwcsName );
431 
432  for(p=path; *p; p++) {
433  if(*p == '\\')
434  *p = '/';
435  }
436 
437  /* add a terminating slash if one does not already exist */
438  if(*(p-1) != '/')
439  {
440  *p++ = '/';
441  *p = 0;
442  }
443 
444  TRACE("Resolving %s\n", debugstr_w(path));
445 
446  return ITSS_create_chm_storage(chmfile, path, ppstg);
447 }
448 
450  IStorage* iface,
451  DWORD ciidExclude,
452  const IID* rgiidExclude,
453  SNB snbExclude,
454  IStorage* pstgDest)
455 {
456  FIXME("\n");
457  return E_NOTIMPL;
458 }
459 
461  IStorage* iface,
462  LPCOLESTR pwcsName,
463  IStorage* pstgDest,
464  LPCOLESTR pwcsNewName,
465  DWORD grfFlags)
466 {
467  FIXME("\n");
468  return E_NOTIMPL;
469 }
470 
472  IStorage* iface,
473  DWORD grfCommitFlags)
474 {
475  FIXME("\n");
476  return E_NOTIMPL;
477 }
478 
480  IStorage* iface)
481 {
482  FIXME("\n");
483  return E_NOTIMPL;
484 }
485 
487  struct chmFile *h,
488  struct chmUnitInfo *ui,
489  void *context)
490 {
491  struct enum_info *info;
492  IEnumSTATSTG_Impl* stgenum = context;
493 
494  TRACE("adding %s to enumeration\n", debugstr_w(ui->path) );
495 
496  info = HeapAlloc( GetProcessHeap(), 0, sizeof (struct enum_info) );
497  info->ui = *ui;
498 
499  info->next = NULL;
500  info->prev = stgenum->last;
501  if( stgenum->last )
502  stgenum->last->next = info;
503  else
504  stgenum->first = info;
505  stgenum->last = info;
506 
508 }
509 
511  IStorage* iface,
512  DWORD reserved1,
513  void* reserved2,
515  IEnumSTATSTG** ppenum)
516 {
518  IEnumSTATSTG_Impl* stgenum;
519 
520  TRACE("%p %d %p %d %p\n", This, reserved1, reserved2, reserved3, ppenum );
521 
522  stgenum = ITSS_create_enum();
523  if( !stgenum )
524  return E_FAIL;
525 
526  chm_enumerate_dir(This->chmfile,
527  This->dir,
530  stgenum );
531 
532  stgenum->current = stgenum->first;
533 
534  *ppenum = &stgenum->IEnumSTATSTG_iface;
535 
536  return S_OK;
537 }
538 
540  IStorage* iface,
541  LPCOLESTR pwcsName)
542 {
543  FIXME("\n");
544  return E_NOTIMPL;
545 }
546 
548  IStorage* iface,
549  LPCOLESTR pwcsOldName,
550  LPCOLESTR pwcsNewName)
551 {
552  FIXME("\n");
553  return E_NOTIMPL;
554 }
555 
557  IStorage* iface,
558  LPCOLESTR pwcsName,
559  const FILETIME* pctime,
560  const FILETIME* patime,
561  const FILETIME* pmtime)
562 {
563  FIXME("\n");
564  return E_NOTIMPL;
565 }
566 
568  IStorage* iface,
569  REFCLSID clsid)
570 {
571  FIXME("\n");
572  return E_NOTIMPL;
573 }
574 
576  IStorage* iface,
577  DWORD grfStateBits,
578  DWORD grfMask)
579 {
580  FIXME("\n");
581  return E_NOTIMPL;
582 }
583 
585  IStorage* iface,
586  STATSTG* pstatstg,
587  DWORD grfStatFlag)
588 {
589  FIXME("\n");
590  return E_NOTIMPL;
591 }
592 
593 static const IStorageVtbl ITSS_IStorageImpl_Vtbl =
594 {
613 };
614 
616  struct chmFile *chmfile, const WCHAR *dir, IStorage** ppstgOpen )
617 {
618  ITSS_IStorageImpl *stg;
619 
620  TRACE("%p %s\n", chmfile, debugstr_w( dir ) );
621 
622  stg = HeapAlloc( GetProcessHeap(), 0,
624  stg->IStorage_iface.lpVtbl = &ITSS_IStorageImpl_Vtbl;
625  stg->ref = 1;
626  stg->chmfile = chmfile;
627  strcpyW( stg->dir, dir );
628 
629  *ppstgOpen = &stg->IStorage_iface;
630 
631  ITSS_LockModule();
632  return S_OK;
633 }
634 
636  const WCHAR* pwcsName,
637  IStorage* pstgPriority,
638  DWORD grfMode,
639  SNB snbExclude,
640  DWORD reserved,
641  IStorage** ppstgOpen)
642 {
643  struct chmFile *chmfile;
644  static const WCHAR szRoot[] = { '/', 0 };
645 
646  TRACE("%s\n", debugstr_w(pwcsName) );
647 
648  chmfile = chm_openW( pwcsName );
649  if( !chmfile )
650  return E_FAIL;
651 
652  return ITSS_create_chm_storage( chmfile, szRoot, ppstgOpen );
653 }
654 
655 /************************************************************************/
656 
658  IStream* iface,
659  REFIID riid,
660  void** ppvObject)
661 {
663 
665  || IsEqualGUID(riid, &IID_ISequentialStream)
666  || IsEqualGUID(riid, &IID_IStream))
667  {
668  IStream_AddRef(iface);
669  *ppvObject = &This->IStream_iface;
670  return S_OK;
671  }
672 
673  WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
674  return E_NOINTERFACE;
675 }
676 
678  IStream* iface)
679 {
681  return InterlockedIncrement(&This->ref);
682 }
683 
685  IStream* iface)
686 {
688 
690 
691  if (ref == 0)
692  {
693  IStorage_Release( &This->stg->IStorage_iface );
696  }
697 
698  return ref;
699 }
700 
702  IStream* iface,
703  void* pv,
704  ULONG cb,
705  ULONG* pcbRead)
706 {
708  ULONG count;
709 
710  TRACE("%p %p %u %p\n", This, pv, cb, pcbRead);
711 
712  count = chm_retrieve_object(This->stg->chmfile,
713  &This->ui, pv, This->addr, cb);
714  This->addr += count;
715  if( pcbRead )
716  *pcbRead = count;
717 
718  return count ? S_OK : S_FALSE;
719 }
720 
722  IStream* iface,
723  const void* pv,
724  ULONG cb,
725  ULONG* pcbWritten)
726 {
727  FIXME("\n");
728  return E_NOTIMPL;
729 }
730 
732  IStream* iface,
733  LARGE_INTEGER dlibMove,
734  DWORD dwOrigin,
735  ULARGE_INTEGER* plibNewPosition)
736 {
738  LONGLONG newpos;
739 
740  TRACE("%p %s %u %p\n", This,
741  wine_dbgstr_longlong( dlibMove.QuadPart ), dwOrigin, plibNewPosition );
742 
743  newpos = This->addr;
744  switch( dwOrigin )
745  {
746  case STREAM_SEEK_CUR:
747  newpos = This->addr + dlibMove.QuadPart;
748  break;
749  case STREAM_SEEK_SET:
750  newpos = dlibMove.QuadPart;
751  break;
752  case STREAM_SEEK_END:
753  newpos = This->ui.length + dlibMove.QuadPart;
754  break;
755  }
756 
757  if( ( newpos < 0 ) || ( newpos > This->ui.length ) )
758  return STG_E_INVALIDPOINTER;
759 
760  This->addr = newpos;
761  if( plibNewPosition )
762  plibNewPosition->QuadPart = This->addr;
763 
764  return S_OK;
765 }
766 
768  IStream* iface,
769  ULARGE_INTEGER libNewSize)
770 {
771  FIXME("\n");
772  return E_NOTIMPL;
773 }
774 
776  IStream* iface,
777  IStream* pstm,
779  ULARGE_INTEGER* pcbRead,
780  ULARGE_INTEGER* pcbWritten)
781 {
782  FIXME("\n");
783  return E_NOTIMPL;
784 }
785 
787  IStream* iface,
788  DWORD grfCommitFlags)
789 {
790  FIXME("\n");
791  return E_NOTIMPL;
792 }
793 
795  IStream* iface)
796 {
797  FIXME("\n");
798  return E_NOTIMPL;
799 }
800 
802  IStream* iface,
803  ULARGE_INTEGER libOffset,
805  DWORD dwLockType)
806 {
807  FIXME("\n");
808  return E_NOTIMPL;
809 }
810 
812  IStream* iface,
813  ULARGE_INTEGER libOffset,
815  DWORD dwLockType)
816 {
817  FIXME("\n");
818  return E_NOTIMPL;
819 }
820 
822  IStream* iface,
823  STATSTG* pstatstg,
824  DWORD grfStatFlag)
825 {
827 
828  TRACE("%p %p %d\n", This, pstatstg, grfStatFlag);
829 
830  memset( pstatstg, 0, sizeof *pstatstg );
831  if( !( grfStatFlag & STATFLAG_NONAME ) )
832  {
833  FIXME("copy the name\n");
834  }
835  pstatstg->type = STGTY_STREAM;
836  pstatstg->cbSize.QuadPart = This->ui.length;
837  pstatstg->grfMode = STGM_READ;
838  pstatstg->clsid = CLSID_ITStorage;
839 
840  return S_OK;
841 }
842 
844  IStream* iface,
845  IStream** ppstm)
846 {
847  FIXME("\n");
848  return E_NOTIMPL;
849 }
850 
851 static const IStreamVtbl ITSS_IStream_vtbl =
852 {
867 };
868 
870  ITSS_IStorageImpl *stg, struct chmUnitInfo *ui )
871 {
872  IStream_Impl *stm;
873 
874  stm = HeapAlloc( GetProcessHeap(), 0, sizeof (IStream_Impl) );
875  stm->IStream_iface.lpVtbl = &ITSS_IStream_vtbl;
876  stm->ref = 1;
877  stm->addr = 0;
878  stm->ui = *ui;
879  stm->stg = stg;
880  IStorage_AddRef( &stg->IStorage_iface );
881 
882  ITSS_LockModule();
883 
884  TRACE(" -> %p\n", stm );
885 
886  return stm;
887 }
struct chmFile * chmfile
Definition: storage.c:50
static HRESULT WINAPI ITSS_IStorageImpl_RenameElement(IStorage *iface, LPCOLESTR pwcsOldName, LPCOLESTR pwcsNewName)
Definition: storage.c:547
#define REFIID
Definition: guiddef.h:113
#define E_NOINTERFACE
Definition: winerror.h:2364
static int ITSS_chm_enumerator(struct chmFile *h, struct chmUnitInfo *ui, void *context)
Definition: storage.c:486
static ULONG WINAPI ITSS_IEnumSTATSTG_AddRef(IEnumSTATSTG *iface)
Definition: storage.c:117
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
const GUID IID_IEnumSTATSTG
struct chmUnitInfo ui
Definition: storage.c:73
#define STG_E_INVALIDPOINTER
Definition: winerror.h:2571
Definition: http.c:6587
static void ITSS_LockModule(void)
Definition: itsstor.h:41
static HRESULT WINAPI ITSS_IStream_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
Definition: storage.c:775
GLsizei const GLchar ** path
Definition: glext.h:7234
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define REFCLSID
Definition: guiddef.h:112
struct _ITSS_IStorageImpl ITSS_IStorageImpl
GLuint GLuint GLsizei count
Definition: gl.h:1545
static ULONG WINAPI ITSS_IStorageImpl_AddRef(IStorage *iface)
Definition: storage.c:294
#define WARN(fmt,...)
Definition: debug.h:111
static HRESULT WINAPI ITSS_IEnumSTATSTG_Next(IEnumSTATSTG *iface, ULONG celt, STATSTG *rgelt, ULONG *pceltFetched)
Definition: storage.c:146
static ULONG WINAPI ITSS_IEnumSTATSTG_Release(IEnumSTATSTG *iface)
Definition: storage.c:124
static HRESULT WINAPI ITSS_IStorageImpl_MoveElementTo(IStorage *iface, LPCOLESTR pwcsName, IStorage *pstgDest, LPCOLESTR pwcsNewName, DWORD grfFlags)
Definition: storage.c:460
UINT ui
Definition: oleauto.h:49
ITSS_IStorageImpl * stg
Definition: storage.c:71
static HRESULT WINAPI ITSS_IEnumSTATSTG_QueryInterface(IEnumSTATSTG *iface, REFIID riid, void **ppvObject)
Definition: storage.c:98
static const IStreamVtbl ITSS_IStream_vtbl
Definition: storage.c:851
static HRESULT WINAPI ITSS_IStorageImpl_OpenStream(IStorage *iface, LPCOLESTR pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm)
Definition: storage.c:330
GLdouble n
Definition: glext.h:7729
GLdouble GLdouble t
Definition: gl.h:2047
struct _IStream_Impl IStream_Impl
static HRESULT WINAPI ITSS_IStorageImpl_SetClass(IStorage *iface, REFCLSID clsid)
Definition: storage.c:567
static HRESULT WINAPI ITSS_IStorageImpl_SetElementTimes(IStorage *iface, LPCOLESTR pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime)
Definition: storage.c:556
#define CHM_ENUMERATE_ALL
Definition: chm_lib.h:104
static void ITSS_UnlockModule(void)
Definition: itsstor.h:42
#define E_FAIL
Definition: ddrawi.h:102
IEnumSTATSTG IEnumSTATSTG_iface
Definition: storage.c:62
static const IEnumSTATSTGVtbl IEnumSTATSTG_vtbl
Definition: storage.c:245
Definition: send.c:47
uint8_t reserved3
Definition: fsck.fat.h:61
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
static HRESULT WINAPI ITSS_IStorageImpl_CreateStream(IStorage *iface, LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm)
Definition: storage.c:318
struct _test_info info[]
Definition: SetCursorPos.c:19
struct chmUnitInfo ui
Definition: storage.c:57
static ULONG WINAPI ITSS_IStorageImpl_Release(IStorage *iface)
Definition: storage.c:301
static IEnumSTATSTG_Impl * ITSS_create_enum(void)
Definition: storage.c:256
struct _IEnumSTATSTG_Impl IEnumSTATSTG_Impl
void chm_close(struct chmFile *h)
Definition: chm_lib.c:865
static ULONG WINAPI ITSS_IStream_AddRef(IStream *iface)
Definition: storage.c:677
static ITSS_IStorageImpl * impl_from_IStorage(IStorage *iface)
Definition: storage.c:76
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
long LONG
Definition: pedump.c:60
ULONGLONG addr
Definition: storage.c:72
#define debugstr_w
Definition: kernel32.h:32
GLenum GLint ref
Definition: glext.h:6028
HRESULT ITSS_StgOpenStorage(const WCHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage.c:635
#define FIXME(fmt,...)
Definition: debug.h:110
r reserved
Definition: btrfs.c:2655
static HRESULT WINAPI ITSS_IStream_QueryInterface(IStream *iface, REFIID riid, void **ppvObject)
Definition: storage.c:657
#define S_FALSE
Definition: winerror.h:2357
const WCHAR * str
static HRESULT WINAPI ITSS_IEnumSTATSTG_Clone(IEnumSTATSTG *iface, IEnumSTATSTG **ppenum)
Definition: storage.c:237
struct enum_info * current
Definition: storage.c:64
smooth NULL
Definition: ftsmooth.c:416
int chm_resolve_object(struct chmFile *h, const WCHAR *objPath, struct chmUnitInfo *ui)
Definition: chm_lib.c:1050
IStorage IStorage_iface
Definition: storage.c:48
struct enum_info * last
Definition: storage.c:64
unsigned int dir
Definition: maze.c:112
static HRESULT WINAPI ITSS_IStream_Write(IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
Definition: storage.c:721
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
LONGINT64 chm_retrieve_object(struct chmFile *h, struct chmUnitInfo *ui, unsigned char *buf, LONGUINT64 addr, LONGINT64 len)
Definition: chm_lib.c:1345
#define STGM_READ
Definition: objbase.h:916
static HRESULT WINAPI ITSS_IStorageImpl_Revert(IStorage *iface)
Definition: storage.c:479
int64_t LONGLONG
Definition: typedefs.h:66
struct enum_info * next
Definition: storage.c:56
static HRESULT WINAPI ITSS_IStream_Clone(IStream *iface, IStream **ppstm)
Definition: storage.c:843
static HRESULT WINAPI ITSS_IStorageImpl_Commit(IStorage *iface, DWORD grfCommitFlags)
Definition: storage.c:471
#define TRACE(s)
Definition: solgame.cpp:4
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp)
uint8_t reserved2[12]
Definition: fsck.fat.h:58
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
uint64_t ULONGLONG
Definition: typedefs.h:65
const GUID IID_IUnknown
static HRESULT WINAPI ITSS_IStorageImpl_OpenStorage(IStorage *iface, LPCOLESTR pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg)
Definition: storage.c:399
#define WINAPI
Definition: msvc.h:8
#define CHM_RESOLVE_SUCCESS
Definition: chm_lib.h:82
static HRESULT WINAPI ITSS_IStorageImpl_SetStateBits(IStorage *iface, DWORD grfStateBits, DWORD grfMask)
Definition: storage.c:575
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT WINAPI ITSS_IStream_Revert(IStream *iface)
Definition: storage.c:794
struct chmFile * chm_openW(const WCHAR *filename)
Definition: chm_lib.c:680
static DWORD cb
Definition: integrity.c:41
static HRESULT WINAPI ITSS_IStorageImpl_EnumElements(IStorage *iface, DWORD reserved1, void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum)
Definition: storage.c:510
#define STG_E_FILENOTFOUND
Definition: winerror.h:2565
REFCLSID clsid
Definition: msctf.c:84
WCHAR dir[1]
Definition: storage.c:51
#define InterlockedDecrement
Definition: armddk.h:52
static HRESULT WINAPI ITSS_IStream_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: storage.c:731
static ULONG WINAPI ITSS_IStream_Release(IStream *iface)
Definition: storage.c:684
GLenum GLsizei len
Definition: glext.h:6722
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static HRESULT WINAPI ITSS_IStream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
Definition: storage.c:811
static HRESULT WINAPI ITSS_IStream_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: storage.c:701
static HRESULT WINAPI ITSS_IStorageImpl_DestroyElement(IStorage *iface, LPCOLESTR pwcsName)
Definition: storage.c:539
LONG ref
Definition: storage.c:70
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define InterlockedIncrement
Definition: armddk.h:53
IStream IStream_iface
Definition: storage.c:69
static HRESULT WINAPI ITSS_IEnumSTATSTG_Skip(IEnumSTATSTG *iface, ULONG celt)
Definition: storage.c:200
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: services.c:325
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
static const IStorageVtbl ITSS_IStorageImpl_Vtbl
Definition: storage.c:593
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
BOOL chm_enumerate_dir(struct chmFile *h, const WCHAR *prefix, int what, CHM_ENUMERATOR e, void *context)
Definition: chm_lib.c:1403
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
struct enum_info * first
Definition: storage.c:64
struct enum_info * prev
Definition: storage.c:56
static HRESULT WINAPI ITSS_IStorageImpl_CreateStorage(IStorage *iface, LPCOLESTR pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage **ppstg)
Definition: storage.c:387
static HRESULT WINAPI ITSS_IStorageImpl_Stat(IStorage *iface, STATSTG *pstatstg, DWORD grfStatFlag)
Definition: storage.c:584
#define CHM_ENUMERATOR_CONTINUE
Definition: chm_lib.h:106
static IStream_Impl * ITSS_create_stream(ITSS_IStorageImpl *stg, struct chmUnitInfo *ui)
Definition: storage.c:869
static HRESULT ITSS_create_chm_storage(struct chmFile *chmfile, const WCHAR *dir, IStorage **ppstgOpen)
Definition: storage.c:615
unsigned int ULONG
Definition: retypes.h:1
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
static IStream_Impl * impl_from_IStream(IStream *iface)
Definition: storage.c:86
static HRESULT WINAPI ITSS_IStream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
Definition: storage.c:767
GLfloat GLfloat p
Definition: glext.h:8902
static HRESULT WINAPI ITSS_IStream_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
Definition: storage.c:801
#define memset(x, y, z)
Definition: compat.h:39
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406
#define HeapFree(x, y, z)
Definition: compat.h:394
static HRESULT WINAPI ITSS_IStorageImpl_CopyTo(IStorage *iface, DWORD ciidExclude, const IID *rgiidExclude, SNB snbExclude, IStorage *pstgDest)
Definition: storage.c:449
LONGLONG QuadPart
Definition: typedefs.h:112
static HRESULT WINAPI ITSS_IStorageImpl_QueryInterface(IStorage *iface, REFIID riid, void **ppvObject)
Definition: storage.c:275
struct chmFile * chm_dup(struct chmFile *oldHandle)
Definition: chm_lib.c:833
static HRESULT WINAPI ITSS_IEnumSTATSTG_Reset(IEnumSTATSTG *iface)
Definition: storage.c:225
static HRESULT WINAPI ITSS_IStream_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
Definition: storage.c:821
static IEnumSTATSTG_Impl * impl_from_IEnumSTATSTG(IEnumSTATSTG *iface)
Definition: storage.c:81
static HRESULT WINAPI ITSS_IStream_Commit(IStream *iface, DWORD grfCommitFlags)
Definition: storage.c:786