ReactOS 0.4.15-dev-7928-g68a8619
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)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 
static IClassFactoryImplimpl_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 ITStorageImplimpl_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)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

LONG dll_count = 0
 
static HINSTANCE hInst
 
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 392 of file itss.c.

393{
394 TRACE("dll_count = %u\n", dll_count);
395 return dll_count ? S_FALSE : S_OK;
396}
#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:2357

◆ DllGetClassObject()

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

Definition at line 163 of file itss.c.

164{
166
167 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
168
169 if (IsEqualGUID(&CLSID_ITStorage, rclsid))
171 else if (IsEqualGUID(&CLSID_MSITStore, rclsid))
173 else if (IsEqualGUID(&CLSID_ITSProtocol, rclsid))
175 else
176 {
177 FIXME("%s: no class found.\n", debugstr_guid(rclsid));
179 }
180
181 return IUnknown_QueryInterface( (IUnknown*) factory, iid, ppv );
182}
#define FIXME(fmt,...)
Definition: debug.h:111
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const IClassFactoryImpl MSITStore_factory
Definition: itss.c:157
static const IClassFactoryImpl ITSProtocol_factory
Definition: itss.c:158
static const IClassFactoryImpl ITStorage_factory
Definition: itss.c:156
#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:2663

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpv 
)

Definition at line 52 of file itss.c.

53{
54 switch(fdwReason) {
57 hInst = hInstDLL;
58 break;
59 }
60 return TRUE;
61}
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static HINSTANCE hInst
Definition: itss.c:50

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 401 of file itss.c.

402{
404}
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 409 of file itss.c.

410{
412}
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

static IClassFactoryImpl * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 71 of file itss.c.

72{
73 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
74}
#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 372 of file itss.c.

373{
374 ITStorageImpl *its;
375
376 if( pUnkOuter )
378
379 its = HeapAlloc( GetProcessHeap(), 0, sizeof(ITStorageImpl) );
381 its->ref = 1;
382
383 TRACE("-> %p\n", its);
384 *ppObj = its;
385
387 return S_OK;
388}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
static const IITStorageVtbl ITStorageImpl_Vtbl
Definition: itss.c:355
static void ITSS_LockModule(void)
Definition: itsstor.h:41
IITStorage IITStorage_iface
Definition: itss.c:187
LONG ref
Definition: itss.c:188
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ ITSSCF_AddRef()

static ULONG WINAPI ITSSCF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 93 of file itss.c.

94{
96 return 2;
97}

◆ ITSSCF_CreateInstance()

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

Definition at line 106 of file itss.c.

108{
110 IUnknown *unk;
112
113 TRACE("(%p)->(%p %s %p)\n", This, outer, debugstr_guid(riid), ppv);
114
115 if(outer && !IsEqualGUID(riid, &IID_IUnknown)) {
116 *ppv = NULL;
118 }
119
120 hres = This->pfnCreateInstance(outer, (void**)&unk);
121 if(FAILED(hres)) {
122 *ppv = NULL;
123 return hres;
124 }
125
127 hres = IUnknown_QueryInterface(unk, riid, ppv);
128 IUnknown_Release(unk);
129 }else {
130 *ppv = unk;
131 }
132 return hres;
133}
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:71
HRESULT hres
Definition: protocol.c:465

◆ ITSSCF_LockServer()

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

Definition at line 135 of file itss.c.

136{
137 TRACE("(%p)->(%d)\n", iface, dolock);
138
139 if (dolock)
141 else
143
144 return S_OK;
145}
static void ITSS_UnlockModule(void)
Definition: itsstor.h:42

◆ ITSSCF_QueryInterface()

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

Definition at line 77 of file itss.c.

78{
80
83 {
84 IClassFactory_AddRef(iface);
85 *ppobj = &This->IClassFactory_iface;
86 return S_OK;
87 }
88
89 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
90 return E_NOINTERFACE;
91}
const GUID IID_IClassFactory
#define WARN(fmt,...)
Definition: debug.h:112
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ITSSCF_Release()

static ULONG WINAPI ITSSCF_Release ( LPCLASSFACTORY  iface)
static

Definition at line 99 of file itss.c.

100{
102 return 1;
103}

◆ ITStorageImpl_AddRef()

static ULONG WINAPI ITStorageImpl_AddRef ( IITStorage iface)
static

Definition at line 215 of file itss.c.

217{
219 TRACE("%p\n", This);
220 return InterlockedIncrement(&This->ref);
221}
#define InterlockedIncrement
Definition: armddk.h:53
static ITStorageImpl * impl_from_IITStorage(IITStorage *iface)
Definition: itss.c:191

◆ ITStorageImpl_Compact()

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

Definition at line 345 of file itss.c.

349{
351 FIXME("%p\n", This);
352 return E_NOTIMPL;
353}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ITStorageImpl_DefaultControlData()

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

Definition at line 336 of file itss.c.

339{
341 FIXME("%p\n", This);
342 return E_NOTIMPL;
343}

◆ ITStorageImpl_QueryInterface()

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

Definition at line 197 of file itss.c.

201{
204 || IsEqualGUID(riid, &IID_IITStorage))
205 {
206 IITStorage_AddRef(iface);
207 *ppvObject = iface;
208 return S_OK;
209 }
210
211 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
212 return E_NOINTERFACE;
213}
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ ITStorageImpl_Release()

static ULONG WINAPI ITStorageImpl_Release ( IITStorage iface)
static

Definition at line 223 of file itss.c.

225{
228
229 if (ref == 0) {
232 }
233
234 return ref;
235}
#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 327 of file itss.c.

330{
332 FIXME("%p\n", This);
333 return E_NOTIMPL;
334}

◆ ITStorageImpl_StgCreateDocfile()

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

Definition at line 237 of file itss.c.

243{
245
246 TRACE("%p %s %u %u %p\n", This,
247 debugstr_w(pwcsName), grfMode, reserved, ppstgOpen );
248
249 return ITSS_StgOpenStorage( pwcsName, NULL, grfMode,
250 0, reserved, ppstgOpen);
251}
r reserved
Definition: btrfs.c:3006
HRESULT ITSS_StgOpenStorage(const WCHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen) DECLSPEC_HIDDEN
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 253 of file itss.c.

259{
261 FIXME("%p\n", This);
262 return E_NOTIMPL;
263}

◆ ITStorageImpl_StgIsStorageFile()

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

Definition at line 265 of file itss.c.

268{
270 FIXME("%p\n", This);
271 return E_NOTIMPL;
272}

◆ ITStorageImpl_StgIsStorageILockBytes()

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

Definition at line 274 of file itss.c.

277{
279 FIXME("%p\n", This);
280 return E_NOTIMPL;
281}

◆ 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 283 of file itss.c.

291{
293
294 TRACE("%p %s %p %d %p\n", This, debugstr_w( pwcsName ),
295 pstgPriority, grfMode, snbExclude );
296
297 return ITSS_StgOpenStorage( pwcsName, pstgPriority, grfMode,
298 snbExclude, reserved, ppstgOpen);
299}

◆ 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 301 of file itss.c.

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

◆ 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 315 of file itss.c.

321{
323 FIXME("%p\n", This);
324 return E_NOTIMPL;
325}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( itss  )

Variable Documentation

◆ dll_count

LONG dll_count = 0

◆ hInst

HINSTANCE hInst
static

Definition at line 50 of file itss.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ ITSProtocol_factory

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

Definition at line 158 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:135
static HRESULT WINAPI ITSSCF_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: itss.c:106
static HRESULT WINAPI ITSSCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj)
Definition: itss.c:77
static ULONG WINAPI ITSSCF_Release(LPCLASSFACTORY iface)
Definition: itss.c:99
static ULONG WINAPI ITSSCF_AddRef(LPCLASSFACTORY iface)
Definition: itss.c:93

Definition at line 147 of file itss.c.

◆ ITStorage_factory

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

Definition at line 156 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:283
static HRESULT WINAPI ITStorageImpl_StgIsStorageFile(IITStorage *iface, const WCHAR *pwcsName)
Definition: itss.c:265
static HRESULT WINAPI ITStorageImpl_Compact(IITStorage *iface, const WCHAR *pwcsName, ECompactionLev iLev)
Definition: itss.c:345
static HRESULT WINAPI ITStorageImpl_StgSetTimes(IITStorage *iface, const WCHAR *lpszName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime)
Definition: itss.c:315
static HRESULT WINAPI ITStorageImpl_QueryInterface(IITStorage *iface, REFIID riid, void **ppvObject)
Definition: itss.c:197
static HRESULT WINAPI ITStorageImpl_StgCreateDocfileOnILockBytes(IITStorage *iface, ILockBytes *plkbyt, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: itss.c:253
static HRESULT WINAPI ITStorageImpl_DefaultControlData(IITStorage *iface, PITS_Control_Data *ppControlData)
Definition: itss.c:336
static ULONG WINAPI ITStorageImpl_AddRef(IITStorage *iface)
Definition: itss.c:215
static HRESULT WINAPI ITStorageImpl_StgIsStorageILockBytes(IITStorage *iface, ILockBytes *plkbyt)
Definition: itss.c:274
static HRESULT WINAPI ITStorageImpl_StgCreateDocfile(IITStorage *iface, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: itss.c:237
static ULONG WINAPI ITStorageImpl_Release(IITStorage *iface)
Definition: itss.c:223
static HRESULT WINAPI ITStorageImpl_StgOpenStorageOnILockBytes(IITStorage *iface, ILockBytes *plkbyt, IStorage *pStgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: itss.c:301
static HRESULT WINAPI ITStorageImpl_SetControlData(IITStorage *iface, PITS_Control_Data pControlData)
Definition: itss.c:327

Definition at line 355 of file itss.c.

Referenced by ITSS_create().

◆ MSITStore_factory

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

Definition at line 157 of file itss.c.

Referenced by DllGetClassObject().