ReactOS 0.4.17-dev-966-gf06eace
itss.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "ole2.h"
#include "rpcproxy.h"
#include "advpub.h"
#include "wine/debug.h"
#include "itsstor.h"
#include "initguid.h"
#include "wine/itss.h"
Include dependency graph for itss.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 
struct  ITStorageImpl
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (itss)
 
static HRESULT ITSS_create (IUnknown *pUnkOuter, LPVOID *ppObj)
 
static IClassFactoryImpl * impl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI ITSSCF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI ITSSCF_AddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI ITSSCF_Release (LPCLASSFACTORY iface)
 
static HRESULT WINAPI ITSSCF_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
static HRESULT WINAPI ITSSCF_LockServer (LPCLASSFACTORY iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
static ITStorageImpl * impl_from_IITStorage (IITStorage *iface)
 
static HRESULT WINAPI ITStorageImpl_QueryInterface (IITStorage *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ITStorageImpl_AddRef (IITStorage *iface)
 
static ULONG WINAPI ITStorageImpl_Release (IITStorage *iface)
 
static HRESULT WINAPI ITStorageImpl_StgCreateDocfile (IITStorage *iface, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
 
static HRESULT WINAPI ITStorageImpl_StgCreateDocfileOnILockBytes (IITStorage *iface, ILockBytes *plkbyt, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
 
static HRESULT WINAPI ITStorageImpl_StgIsStorageFile (IITStorage *iface, const WCHAR *pwcsName)
 
static HRESULT WINAPI ITStorageImpl_StgIsStorageILockBytes (IITStorage *iface, ILockBytes *plkbyt)
 
static HRESULT WINAPI ITStorageImpl_StgOpenStorage (IITStorage *iface, const WCHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
 
static HRESULT WINAPI ITStorageImpl_StgOpenStorageOnILockBytes (IITStorage *iface, ILockBytes *plkbyt, IStorage *pStgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
 
static HRESULT WINAPI ITStorageImpl_StgSetTimes (IITStorage *iface, const WCHAR *lpszName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime)
 
static HRESULT WINAPI ITStorageImpl_SetControlData (IITStorage *iface, PITS_Control_Data pControlData)
 
static HRESULT WINAPI ITStorageImpl_DefaultControlData (IITStorage *iface, PITS_Control_Data *ppControlData)
 
static HRESULT WINAPI ITStorageImpl_Compact (IITStorage *iface, const WCHAR *pwcsName, ECompactionLev iLev)
 
HRESULT WINAPI DllCanUnloadNow (void)
 

Variables

LONG dll_count = 0
 
static const IClassFactoryVtbl ITSSCF_Vtbl
 
static const IClassFactoryImpl ITStorage_factory = { { &ITSSCF_Vtbl }, ITSS_create }
 
static const IClassFactoryImpl MSITStore_factory = { { &ITSSCF_Vtbl }, ITS_IParseDisplayName_create }
 
static const IClassFactoryImpl ITSProtocol_factory = { { &ITSSCF_Vtbl }, ITSProtocol_create }
 
static const IITStorageVtbl ITStorageImpl_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 28 of file itss.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 380 of file itss.c.

381{
382 TRACE("dll_count = %lu\n", dll_count);
383 return dll_count ? S_FALSE : S_OK;
384}
#define S_OK
Definition: intsafe.h:52
LONG dll_count
Definition: itss.c:49
#define TRACE(s)
Definition: solgame.cpp:4
#define S_FALSE
Definition: winerror.h:3451

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID *  ppv 
)

Definition at line 151 of file itss.c.

152{
154
155 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
156
157 if (IsEqualGUID(&CLSID_ITStorage, rclsid))
159 else if (IsEqualGUID(&CLSID_MSITStore, rclsid))
161 else if (IsEqualGUID(&CLSID_ITSProtocol, rclsid))
163 else
164 {
165 FIXME("%s: no class found.\n", debugstr_guid(rclsid));
167 }
168
169 return IUnknown_QueryInterface( (IUnknown*) factory, iid, ppv );
170}
#define FIXME(fmt,...)
Definition: precomp.h:53
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const IClassFactoryImpl MSITStore_factory
Definition: itss.c:145
static const IClassFactoryImpl ITSProtocol_factory
Definition: itss.c:146
static const IClassFactoryImpl ITStorage_factory
Definition: itss.c:144
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
Definition: main.c:439
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772

◆ impl_from_IClassFactory()

static IClassFactoryImpl * impl_from_IClassFactory ( IClassFactory *  iface)
inlinestatic

Definition at line 59 of file itss.c.

60{
61 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
62}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by ITSSCF_CreateInstance(), and ITSSCF_QueryInterface().

◆ impl_from_IITStorage()

◆ ITSS_create()

static HRESULT ITSS_create ( IUnknown *  pUnkOuter,
LPVOID *  ppObj 
)
static

Definition at line 360 of file itss.c.

361{
362 ITStorageImpl *its;
363
364 if( pUnkOuter )
366
367 its = HeapAlloc( GetProcessHeap(), 0, sizeof(ITStorageImpl) );
369 its->ref = 1;
370
371 TRACE("-> %p\n", its);
372 *ppObj = its;
373
375 return S_OK;
376}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
static const IITStorageVtbl ITStorageImpl_Vtbl
Definition: itss.c:343
static void ITSS_LockModule(void)
Definition: itsstor.h:39
IITStorage IITStorage_iface
Definition: itss.c:175
LONG ref
Definition: itss.c:176
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ ITSSCF_AddRef()

static ULONG WINAPI ITSSCF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 81 of file itss.c.

82{
84 return 2;
85}

◆ ITSSCF_CreateInstance()

static HRESULT WINAPI ITSSCF_CreateInstance ( IClassFactory *  iface,
IUnknown *  outer,
REFIID  riid,
void **  ppv 
)
static

Definition at line 94 of file itss.c.

96{
98 IUnknown *unk;
100
101 TRACE("(%p)->(%p %s %p)\n", This, outer, debugstr_guid(riid), ppv);
102
104 *ppv = NULL;
106 }
107
108 hres = This->pfnCreateInstance(outer, (void**)&unk);
109 if(FAILED(hres)) {
110 *ppv = NULL;
111 return hres;
112 }
113
115 hres = IUnknown_QueryInterface(unk, riid, ppv);
116 IUnknown_Release(unk);
117 }else {
118 *ppv = unk;
119 }
120 return hres;
121}
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: itss.c:59
HRESULT hres
Definition: protocol.c:432
static IUnknown * outer
Definition: compobj.c:82

◆ ITSSCF_LockServer()

static HRESULT WINAPI ITSSCF_LockServer ( LPCLASSFACTORY  iface,
BOOL  dolock 
)
static

Definition at line 123 of file itss.c.

124{
125 TRACE("(%p)->(%d)\n", iface, dolock);
126
127 if (dolock)
129 else
131
132 return S_OK;
133}
static void ITSS_UnlockModule(void)
Definition: itsstor.h:40

◆ ITSSCF_QueryInterface()

static HRESULT WINAPI ITSSCF_QueryInterface ( LPCLASSFACTORY  iface,
REFIID  riid,
LPVOID *  ppobj 
)
static

Definition at line 65 of file itss.c.

66{
68
71 {
72 IClassFactory_AddRef(iface);
73 *ppobj = &This->IClassFactory_iface;
74 return S_OK;
75 }
76
77 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
78 return E_NOINTERFACE;
79}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ ITSSCF_Release()

static ULONG WINAPI ITSSCF_Release ( LPCLASSFACTORY  iface)
static

Definition at line 87 of file itss.c.

88{
90 return 1;
91}

◆ ITStorageImpl_AddRef()

static ULONG WINAPI ITStorageImpl_AddRef ( IITStorage *  iface)
static

Definition at line 203 of file itss.c.

205{
207 TRACE("%p\n", This);
208 return InterlockedIncrement(&This->ref);
209}
#define InterlockedIncrement
Definition: armddk.h:53
static ITStorageImpl * impl_from_IITStorage(IITStorage *iface)
Definition: itss.c:179

◆ ITStorageImpl_Compact()

static HRESULT WINAPI ITStorageImpl_Compact ( IITStorage *  iface,
const WCHAR *  pwcsName,
ECompactionLev  iLev 
)
static

Definition at line 333 of file itss.c.

337{
339 FIXME("%p\n", This);
340 return E_NOTIMPL;
341}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ITStorageImpl_DefaultControlData()

static HRESULT WINAPI ITStorageImpl_DefaultControlData ( IITStorage *  iface,
PITS_Control_Data *  ppControlData 
)
static

Definition at line 324 of file itss.c.

327{
329 FIXME("%p\n", This);
330 return E_NOTIMPL;
331}

◆ ITStorageImpl_QueryInterface()

static HRESULT WINAPI ITStorageImpl_QueryInterface ( IITStorage *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 185 of file itss.c.

189{
192 || IsEqualGUID(riid, &IID_IITStorage))
193 {
194 IITStorage_AddRef(iface);
195 *ppvObject = iface;
196 return S_OK;
197 }
198
199 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
200 return E_NOINTERFACE;
201}

◆ ITStorageImpl_Release()

static ULONG WINAPI ITStorageImpl_Release ( IITStorage *  iface)
static

Definition at line 211 of file itss.c.

213{
216
217 if (ref == 0) {
220 }
221
222 return ref;
223}
#define InterlockedDecrement
Definition: armddk.h:52
#define HeapFree(x, y, z)
Definition: compat.h:735
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ ITStorageImpl_SetControlData()

static HRESULT WINAPI ITStorageImpl_SetControlData ( IITStorage *  iface,
PITS_Control_Data  pControlData 
)
static

Definition at line 315 of file itss.c.

318{
320 FIXME("%p\n", This);
321 return E_NOTIMPL;
322}

◆ ITStorageImpl_StgCreateDocfile()

static HRESULT WINAPI ITStorageImpl_StgCreateDocfile ( IITStorage *  iface,
const WCHAR *  pwcsName,
DWORD  grfMode,
DWORD  reserved,
IStorage **  ppstgOpen 
)
static

Definition at line 225 of file itss.c.

231{
233
234 TRACE("%p %s %lu %lu %p\n", This,
235 debugstr_w(pwcsName), grfMode, reserved, ppstgOpen );
236
237 return ITSS_StgOpenStorage( pwcsName, NULL, grfMode,
238 0, reserved, ppstgOpen);
239}
r reserved
Definition: btrfs.c:3006
HRESULT ITSS_StgOpenStorage(const WCHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage.c:633
#define debugstr_w
Definition: kernel32.h:32

◆ ITStorageImpl_StgCreateDocfileOnILockBytes()

static HRESULT WINAPI ITStorageImpl_StgCreateDocfileOnILockBytes ( IITStorage *  iface,
ILockBytes *  plkbyt,
DWORD  grfMode,
DWORD  reserved,
IStorage **  ppstgOpen 
)
static

Definition at line 241 of file itss.c.

247{
249 FIXME("%p\n", This);
250 return E_NOTIMPL;
251}

◆ ITStorageImpl_StgIsStorageFile()

static HRESULT WINAPI ITStorageImpl_StgIsStorageFile ( IITStorage *  iface,
const WCHAR *  pwcsName 
)
static

Definition at line 253 of file itss.c.

256{
258 FIXME("%p\n", This);
259 return E_NOTIMPL;
260}

◆ ITStorageImpl_StgIsStorageILockBytes()

static HRESULT WINAPI ITStorageImpl_StgIsStorageILockBytes ( IITStorage *  iface,
ILockBytes *  plkbyt 
)
static

Definition at line 262 of file itss.c.

265{
267 FIXME("%p\n", This);
268 return E_NOTIMPL;
269}

◆ ITStorageImpl_StgOpenStorage()

static HRESULT WINAPI ITStorageImpl_StgOpenStorage ( IITStorage *  iface,
const WCHAR *  pwcsName,
IStorage *  pstgPriority,
DWORD  grfMode,
SNB  snbExclude,
DWORD  reserved,
IStorage **  ppstgOpen 
)
static

Definition at line 271 of file itss.c.

279{
281
282 TRACE("%p %s %p %ld %p\n", This, debugstr_w( pwcsName ),
283 pstgPriority, grfMode, snbExclude );
284
285 return ITSS_StgOpenStorage( pwcsName, pstgPriority, grfMode,
286 snbExclude, reserved, ppstgOpen);
287}

◆ ITStorageImpl_StgOpenStorageOnILockBytes()

static HRESULT WINAPI ITStorageImpl_StgOpenStorageOnILockBytes ( IITStorage *  iface,
ILockBytes *  plkbyt,
IStorage *  pStgPriority,
DWORD  grfMode,
SNB  snbExclude,
DWORD  reserved,
IStorage **  ppstgOpen 
)
static

Definition at line 289 of file itss.c.

297{
299 FIXME("%p\n", This);
300 return E_NOTIMPL;
301}

◆ ITStorageImpl_StgSetTimes()

static HRESULT WINAPI ITStorageImpl_StgSetTimes ( IITStorage *  iface,
const WCHAR *  lpszName,
const FILETIME *  pctime,
const FILETIME *  patime,
const FILETIME *  pmtime 
)
static

Definition at line 303 of file itss.c.

309{
311 FIXME("%p\n", This);
312 return E_NOTIMPL;
313}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( itss  )

Variable Documentation

◆ dll_count

LONG dll_count = 0

◆ ITSProtocol_factory

const IClassFactoryImpl ITSProtocol_factory = { { &ITSSCF_Vtbl }, ITSProtocol_create }
static

Definition at line 146 of file itss.c.

Referenced by DllGetClassObject().

◆ ITSSCF_Vtbl

const IClassFactoryVtbl ITSSCF_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ITSSCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
Definition: itss.c:123
static HRESULT WINAPI ITSSCF_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: itss.c:94
static HRESULT WINAPI ITSSCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
Definition: itss.c:65
static ULONG WINAPI ITSSCF_Release(LPCLASSFACTORY iface)
Definition: itss.c:87
static ULONG WINAPI ITSSCF_AddRef(LPCLASSFACTORY iface)
Definition: itss.c:81

Definition at line 135 of file itss.c.

◆ ITStorage_factory

const IClassFactoryImpl ITStorage_factory = { { &ITSSCF_Vtbl }, ITSS_create }
static

Definition at line 144 of file itss.c.

Referenced by DllGetClassObject().

◆ ITStorageImpl_Vtbl

const IITStorageVtbl ITStorageImpl_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI ITStorageImpl_StgOpenStorage(IITStorage *iface, const WCHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: itss.c:271
static HRESULT WINAPI ITStorageImpl_StgIsStorageFile(IITStorage *iface, const WCHAR *pwcsName)
Definition: itss.c:253
static HRESULT WINAPI ITStorageImpl_Compact(IITStorage *iface, const WCHAR *pwcsName, ECompactionLev iLev)
Definition: itss.c:333
static HRESULT WINAPI ITStorageImpl_StgSetTimes(IITStorage *iface, const WCHAR *lpszName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime)
Definition: itss.c:303
static HRESULT WINAPI ITStorageImpl_QueryInterface(IITStorage *iface, REFIID riid, void **ppvObject)
Definition: itss.c:185
static HRESULT WINAPI ITStorageImpl_StgCreateDocfileOnILockBytes(IITStorage *iface, ILockBytes *plkbyt, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: itss.c:241
static HRESULT WINAPI ITStorageImpl_DefaultControlData(IITStorage *iface, PITS_Control_Data *ppControlData)
Definition: itss.c:324
static ULONG WINAPI ITStorageImpl_AddRef(IITStorage *iface)
Definition: itss.c:203
static HRESULT WINAPI ITStorageImpl_StgIsStorageILockBytes(IITStorage *iface, ILockBytes *plkbyt)
Definition: itss.c:262
static HRESULT WINAPI ITStorageImpl_StgCreateDocfile(IITStorage *iface, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: itss.c:225
static ULONG WINAPI ITStorageImpl_Release(IITStorage *iface)
Definition: itss.c:211
static HRESULT WINAPI ITStorageImpl_StgOpenStorageOnILockBytes(IITStorage *iface, ILockBytes *plkbyt, IStorage *pStgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: itss.c:289
static HRESULT WINAPI ITStorageImpl_SetControlData(IITStorage *iface, PITS_Control_Data pControlData)
Definition: itss.c:315

Definition at line 343 of file itss.c.

Referenced by ITSS_create().

◆ MSITStore_factory

const IClassFactoryImpl MSITStore_factory = { { &ITSSCF_Vtbl }, ITS_IParseDisplayName_create }
static

Definition at line 145 of file itss.c.

Referenced by DllGetClassObject().