ReactOS 0.4.15-dev-5672-gf73ac17
moniker.c File Reference
#include <stdarg.h>
#include <string.h>
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winsvc.h"
#include "wtypes.h"
#include "ole2.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "compobj_private.h"
#include "moniker.h"
#include "irot.h"
Include dependency graph for moniker.c:

Go to the source code of this file.

Classes

struct  rot_entry
 
struct  RunningObjectTableImpl
 
struct  EnumMonikerImpl
 
struct  MonikerMarshal
 

Macros

#define COBJMACROS
 
#define MAX_COMPARISON_DATA   2048
 

Typedefs

typedef struct RunningObjectTableImpl RunningObjectTableImpl
 
typedef struct EnumMonikerImpl EnumMonikerImpl
 
typedef struct MonikerMarshal MonikerMarshal
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static LONG WINAPI rpc_filter (EXCEPTION_POINTERS *eptr)
 
static RunningObjectTableImplimpl_from_IRunningObjectTable (IRunningObjectTable *iface)
 
static EnumMonikerImplimpl_from_IEnumMoniker (IEnumMoniker *iface)
 
static HRESULT EnumMonikerImpl_CreateEnumROTMoniker (InterfaceList *moniker_list, ULONG pos, IEnumMoniker **ppenumMoniker)
 
static IrotHandle get_irot_handle (void)
 
static BOOL start_rpcss (void)
 
static HRESULT create_stream_on_mip_ro (const InterfaceData *mip, IStream **stream)
 
static void rot_entry_delete (struct rot_entry *rot_entry)
 
static HRESULT get_moniker_comparison_data (IMoniker *pMoniker, MonikerComparisonData **moniker_data)
 
static HRESULT reduce_moniker (IMoniker *pmk, IBindCtx *pbc, IMoniker **pmkReduced)
 
static HRESULT WINAPI RunningObjectTableImpl_QueryInterface (IRunningObjectTable *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI RunningObjectTableImpl_AddRef (IRunningObjectTable *iface)
 
static HRESULT RunningObjectTableImpl_Destroy (void)
 
static ULONG WINAPI RunningObjectTableImpl_Release (IRunningObjectTable *iface)
 
static HRESULT WINAPI RunningObjectTableImpl_Register (IRunningObjectTable *iface, DWORD grfFlags, IUnknown *punkObject, IMoniker *pmkObjectName, DWORD *pdwRegister)
 
static HRESULT WINAPI RunningObjectTableImpl_Revoke (IRunningObjectTable *iface, DWORD dwRegister)
 
static HRESULT WINAPI RunningObjectTableImpl_IsRunning (IRunningObjectTable *iface, IMoniker *pmkObjectName)
 
static HRESULT WINAPI RunningObjectTableImpl_GetObject (IRunningObjectTable *iface, IMoniker *pmkObjectName, IUnknown **ppunkObject)
 
static HRESULT WINAPI RunningObjectTableImpl_NoteChangeTime (IRunningObjectTable *iface, DWORD dwRegister, FILETIME *pfiletime)
 
static HRESULT WINAPI RunningObjectTableImpl_GetTimeOfLastChange (IRunningObjectTable *iface, IMoniker *pmkObjectName, FILETIME *pfiletime)
 
static HRESULT WINAPI RunningObjectTableImpl_EnumRunning (IRunningObjectTable *iface, IEnumMoniker **ppenumMoniker)
 
HRESULT WINAPI RunningObjectTableImpl_Initialize (void)
 
HRESULT WINAPI RunningObjectTableImpl_UnInitialize (void)
 
HRESULT WINAPI GetRunningObjectTable (DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
 
static HRESULT get_moniker_for_progid_display_name (LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, LPMONIKER *ppmk)
 
HRESULT WINAPI MkParseDisplayName (LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, LPMONIKER *ppmk)
 
HRESULT WINAPI GetClassFile (LPCOLESTR filePathName, CLSID *pclsid)
 
static HRESULT WINAPI EnumMonikerImpl_QueryInterface (IEnumMoniker *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI EnumMonikerImpl_AddRef (IEnumMoniker *iface)
 
static ULONG WINAPI EnumMonikerImpl_Release (IEnumMoniker *iface)
 
static HRESULT WINAPI EnumMonikerImpl_Next (IEnumMoniker *iface, ULONG celt, IMoniker **rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI EnumMonikerImpl_Skip (IEnumMoniker *iface, ULONG celt)
 
static HRESULT WINAPI EnumMonikerImpl_Reset (IEnumMoniker *iface)
 
static HRESULT WINAPI EnumMonikerImpl_Clone (IEnumMoniker *iface, IEnumMoniker **ppenum)
 
static MonikerMarshalimpl_from_IUnknown (IUnknown *iface)
 
static MonikerMarshalimpl_from_IMarshal (IMarshal *iface)
 
static HRESULT WINAPI MonikerMarshalInner_QueryInterface (IUnknown *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI MonikerMarshalInner_AddRef (IUnknown *iface)
 
static ULONG WINAPI MonikerMarshalInner_Release (IUnknown *iface)
 
static HRESULT WINAPI MonikerMarshal_QueryInterface (IMarshal *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI MonikerMarshal_AddRef (IMarshal *iface)
 
static ULONG WINAPI MonikerMarshal_Release (IMarshal *iface)
 
static HRESULT WINAPI MonikerMarshal_GetUnmarshalClass (LPMARSHAL iface, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *pCid)
 
static HRESULT WINAPI MonikerMarshal_GetMarshalSizeMax (LPMARSHAL iface, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, DWORD *pSize)
 
static HRESULT WINAPI MonikerMarshal_MarshalInterface (LPMARSHAL iface, IStream *pStm, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags)
 
static HRESULT WINAPI MonikerMarshal_UnmarshalInterface (LPMARSHAL iface, IStream *pStm, REFIID riid, void **ppv)
 
static HRESULT WINAPI MonikerMarshal_ReleaseMarshalData (LPMARSHAL iface, IStream *pStm)
 
static HRESULT WINAPI MonikerMarshal_DisconnectObject (LPMARSHAL iface, DWORD dwReserved)
 
HRESULT MonikerMarshal_Create (IMoniker *inner, IUnknown **outer)
 
void *__RPC_USER MIDL_user_allocate (SIZE_T size)
 
void __RPC_USER MIDL_user_free (void *p)
 

Variables

static RunningObjectTableImplrunningObjectTableInstance = NULL
 
static IrotHandle irot_handle
 
static const IRunningObjectTableVtbl VT_RunningObjectTableImpl
 
static const IEnumMonikerVtbl VT_EnumMonikerImpl
 
static const IUnknownVtbl VT_MonikerMarshalInner
 
static const IMarshalVtbl VT_MonikerMarshal
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 27 of file moniker.c.

◆ MAX_COMPARISON_DATA

#define MAX_COMPARISON_DATA   2048

Definition at line 50 of file moniker.c.

Typedef Documentation

◆ EnumMonikerImpl

◆ MonikerMarshal

◆ RunningObjectTableImpl

Function Documentation

◆ create_stream_on_mip_ro()

static HRESULT create_stream_on_mip_ro ( const InterfaceData *  mip,
IStream **  stream 
)
static

Definition at line 179 of file moniker.c.

180{
181 HGLOBAL hglobal = GlobalAlloc(0, mip->ulCntData);
182 void *pv = GlobalLock(hglobal);
183 memcpy(pv, mip->abData, mip->ulCntData);
184 GlobalUnlock(hglobal);
185 return CreateStreamOnHGlobal(hglobal, TRUE, stream);
186}
#define TRUE
Definition: types.h:120
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: parse.h:23

Referenced by EnumMonikerImpl_Next(), rot_entry_delete(), and RunningObjectTableImpl_GetObject().

◆ EnumMonikerImpl_AddRef()

static ULONG WINAPI EnumMonikerImpl_AddRef ( IEnumMoniker iface)
static

Definition at line 1333 of file moniker.c.

1334{
1336
1337 TRACE("(%p)\n",This);
1338
1339 return InterlockedIncrement(&This->ref);
1340}
#define InterlockedIncrement
Definition: armddk.h:53
static EnumMonikerImpl * impl_from_IEnumMoniker(IEnumMoniker *iface)
Definition: moniker.c:96
#define TRACE(s)
Definition: solgame.cpp:4

◆ EnumMonikerImpl_Clone()

static HRESULT WINAPI EnumMonikerImpl_Clone ( IEnumMoniker iface,
IEnumMoniker **  ppenum 
)
static

Definition at line 1438 of file moniker.c.

1439{
1441 InterfaceList *moniker_list;
1442 ULONG i;
1443
1444 TRACE("(%p)\n",This);
1445
1446 *ppenum = NULL;
1447
1448 moniker_list = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceList, interfaces[This->moniker_list->size]));
1449 if (!moniker_list)
1450 return E_OUTOFMEMORY;
1451
1452 moniker_list->size = This->moniker_list->size;
1453 for (i = 0; i < This->moniker_list->size; i++)
1454 {
1455 SIZE_T size = FIELD_OFFSET(InterfaceData, abData[This->moniker_list->interfaces[i]->ulCntData]);
1456 moniker_list->interfaces[i] = HeapAlloc(GetProcessHeap(), 0, size);
1457 if (!moniker_list->interfaces[i])
1458 {
1459 ULONG end = i;
1460 for (i = 0; i < end; i++)
1461 HeapFree(GetProcessHeap(), 0, moniker_list->interfaces[i]);
1462 HeapFree(GetProcessHeap(), 0, moniker_list);
1463 return E_OUTOFMEMORY;
1464 }
1465 memcpy(moniker_list->interfaces[i], This->moniker_list->interfaces[i], size);
1466 }
1467
1468 /* copy the enum structure */
1469 return EnumMonikerImpl_CreateEnumROTMoniker(moniker_list, This->pos, ppenum);
1470}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static HRESULT EnumMonikerImpl_CreateEnumROTMoniker(InterfaceList *moniker_list, ULONG pos, IEnumMoniker **ppenumMoniker)
Definition: moniker.c:1489
GLuint GLuint end
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
_In_ PUSBD_INTERFACE_LIST_ENTRY InterfaceList
Definition: usbdlib.h:181

◆ EnumMonikerImpl_CreateEnumROTMoniker()

static HRESULT EnumMonikerImpl_CreateEnumROTMoniker ( InterfaceList moniker_list,
ULONG  pos,
IEnumMoniker **  ppenumMoniker 
)
static

Definition at line 1489 of file moniker.c.

1492{
1494
1495 if (!ppenumMoniker)
1496 return E_INVALIDARG;
1497
1499 if (!This) return E_OUTOFMEMORY;
1500
1501 TRACE("(%p)\n", This);
1502
1503 /* initialize the virtual table function */
1504 This->IEnumMoniker_iface.lpVtbl = &VT_EnumMonikerImpl;
1505
1506 /* the initial reference is set to "1" */
1507 This->ref = 1; /* set the ref count to one */
1508 This->pos = current_pos; /* Set the list start posn */
1509 This->moniker_list = moniker_list;
1510
1511 *ppenumMoniker = &This->IEnumMoniker_iface;
1512
1513 return S_OK;
1514}
#define E_INVALIDARG
Definition: ddrawi.h:101
static const IEnumMonikerVtbl VT_EnumMonikerImpl
Definition: moniker.c:1473
#define S_OK
Definition: intsafe.h:52

Referenced by EnumMonikerImpl_Clone(), and RunningObjectTableImpl_EnumRunning().

◆ EnumMonikerImpl_Next()

static HRESULT WINAPI EnumMonikerImpl_Next ( IEnumMoniker iface,
ULONG  celt,
IMoniker **  rgelt,
ULONG pceltFetched 
)
static

Definition at line 1372 of file moniker.c.

1373{
1374 ULONG i;
1376 HRESULT hr = S_OK;
1377
1378 TRACE("(%p) TabCurrentPos %d Tablastindx %d\n", This, This->pos, This->moniker_list->size);
1379
1380 /* retrieve the requested number of moniker from the current position */
1381 for(i = 0; (This->pos < This->moniker_list->size) && (i < celt); i++)
1382 {
1383 IStream *stream;
1384 hr = create_stream_on_mip_ro(This->moniker_list->interfaces[This->pos++], &stream);
1385 if (hr != S_OK) break;
1386 hr = CoUnmarshalInterface(stream, &IID_IMoniker, (void **)&rgelt[i]);
1387 IStream_Release(stream);
1388 if (hr != S_OK) break;
1389 }
1390
1391 if (pceltFetched != NULL)
1392 *pceltFetched= i;
1393
1394 if (hr != S_OK)
1395 return hr;
1396
1397 if (i == celt)
1398 return S_OK;
1399 else
1400 return S_FALSE;
1401
1402}
HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv)
Definition: marshal.c:1981
static HRESULT create_stream_on_mip_ro(const InterfaceData *mip, IStream **stream)
Definition: moniker.c:179
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357

◆ EnumMonikerImpl_QueryInterface()

static HRESULT WINAPI EnumMonikerImpl_QueryInterface ( IEnumMoniker iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1309 of file moniker.c.

1310{
1312
1313 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
1314
1315 /* validate arguments */
1316 if (ppvObject == NULL)
1317 return E_INVALIDARG;
1318
1319 *ppvObject = NULL;
1320
1322 *ppvObject = &This->IEnumMoniker_iface;
1323 else
1324 return E_NOINTERFACE;
1325
1326 IEnumMoniker_AddRef(iface);
1327 return S_OK;
1328}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IEnumMoniker
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ EnumMonikerImpl_Release()

static ULONG WINAPI EnumMonikerImpl_Release ( IEnumMoniker iface)
static

Definition at line 1345 of file moniker.c.

1346{
1348 ULONG ref;
1349
1350 TRACE("(%p)\n",This);
1351
1352 ref = InterlockedDecrement(&This->ref);
1353
1354 /* uninitialize ROT structure if there are no more references to it */
1355 if (ref == 0)
1356 {
1357 ULONG i;
1358
1359 TRACE("(%p) Deleting\n",This);
1360
1361 for (i = 0; i < This->moniker_list->size; i++)
1362 HeapFree(GetProcessHeap(), 0, This->moniker_list->interfaces[i]);
1363 HeapFree(GetProcessHeap(), 0, This->moniker_list);
1365 }
1366
1367 return ref;
1368}
#define InterlockedDecrement
Definition: armddk.h:52
Definition: send.c:48

◆ EnumMonikerImpl_Reset()

static HRESULT WINAPI EnumMonikerImpl_Reset ( IEnumMoniker iface)
static

Definition at line 1424 of file moniker.c.

1425{
1427
1428 This->pos = 0; /* set back to start of list */
1429
1430 TRACE("(%p)\n",This);
1431
1432 return S_OK;
1433}

◆ EnumMonikerImpl_Skip()

static HRESULT WINAPI EnumMonikerImpl_Skip ( IEnumMoniker iface,
ULONG  celt 
)
static

Definition at line 1407 of file moniker.c.

1408{
1410
1411 TRACE("(%p)\n",This);
1412
1413 if (This->pos + celt >= This->moniker_list->size)
1414 return S_FALSE;
1415
1416 This->pos += celt;
1417
1418 return S_OK;
1419}

◆ get_irot_handle()

static IrotHandle get_irot_handle ( void  )
static

Definition at line 105 of file moniker.c.

106{
107 if (!irot_handle)
108 {
110 RPC_WSTR binding;
111 IrotHandle new_handle;
112 unsigned short ncacn_np[] = IROT_PROTSEQ;
113 unsigned short endpoint[] = IROT_ENDPOINT;
114 status = RpcStringBindingComposeW(NULL, ncacn_np, NULL, endpoint, NULL, &binding);
115 if (status == RPC_S_OK)
116 {
117 status = RpcBindingFromStringBindingW(binding, &new_handle);
118 RpcStringFreeW(&binding);
119 }
120 if (status != RPC_S_OK)
121 return NULL;
123 /* another thread beat us to it */
124 RpcBindingFree(&new_handle);
125 }
126 return irot_handle;
127}
static IrotHandle irot_handle
Definition: moniker.c:79
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:880
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:510
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787
unsigned short * RPC_WSTR
Definition: rpcdce.h:46
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
long RPC_STATUS
Definition: rpc.h:52
Definition: nis.h:10
Definition: ps.c:97

Referenced by rot_entry_delete(), RunningObjectTableImpl_EnumRunning(), RunningObjectTableImpl_GetObject(), RunningObjectTableImpl_GetTimeOfLastChange(), RunningObjectTableImpl_IsRunning(), RunningObjectTableImpl_NoteChangeTime(), and RunningObjectTableImpl_Register().

◆ get_moniker_comparison_data()

static HRESULT get_moniker_comparison_data ( IMoniker pMoniker,
MonikerComparisonData **  moniker_data 
)
static

Definition at line 234 of file moniker.c.

235{
236 HRESULT hr;
237 IROTData *pROTData = NULL;
238 hr = IMoniker_QueryInterface(pMoniker, &IID_IROTData, (void *)&pROTData);
239 if (SUCCEEDED(hr))
240 {
242 *moniker_data = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MonikerComparisonData, abData[size]));
243 if (!*moniker_data)
244 {
245 IROTData_Release(pROTData);
246 return E_OUTOFMEMORY;
247 }
248 hr = IROTData_GetComparisonData(pROTData, (*moniker_data)->abData, size, &size);
249 IROTData_Release(pROTData);
250 if (hr != S_OK)
251 {
252 ERR("Failed to copy comparison data into buffer, hr = 0x%08x\n", hr);
253 HeapFree(GetProcessHeap(), 0, *moniker_data);
254 return hr;
255 }
256 (*moniker_data)->ulCntData = size;
257 }
258 else
259 {
260 IBindCtx *pbc;
261 LPOLESTR pszDisplayName;
262 CLSID clsid;
263 int len;
264
265 TRACE("generating comparison data from display name\n");
266
267 hr = CreateBindCtx(0, &pbc);
268 if (FAILED(hr))
269 return hr;
270 hr = IMoniker_GetDisplayName(pMoniker, pbc, NULL, &pszDisplayName);
271 IBindCtx_Release(pbc);
272 if (FAILED(hr))
273 return hr;
274 hr = IMoniker_GetClassID(pMoniker, &clsid);
275 if (FAILED(hr))
276 {
277 CoTaskMemFree(pszDisplayName);
278 return hr;
279 }
280
281 len = lstrlenW(pszDisplayName);
282 *moniker_data = HeapAlloc(GetProcessHeap(), 0,
283 FIELD_OFFSET(MonikerComparisonData, abData[sizeof(CLSID) + (len+1)*sizeof(WCHAR)]));
284 if (!*moniker_data)
285 {
286 CoTaskMemFree(pszDisplayName);
287 return E_OUTOFMEMORY;
288 }
289 (*moniker_data)->ulCntData = sizeof(CLSID) + (len+1)*sizeof(WCHAR);
290
291 memcpy(&(*moniker_data)->abData[0], &clsid, sizeof(clsid));
292 memcpy(&(*moniker_data)->abData[sizeof(clsid)], pszDisplayName, (len+1)*sizeof(WCHAR));
293 CoTaskMemFree(pszDisplayName);
294 }
295 return S_OK;
296}
#define ERR(fmt,...)
Definition: debug.h:110
#define lstrlenW
Definition: compat.h:750
#define MAX_COMPARISON_DATA
Definition: moniker.c:50
GLenum GLsizei len
Definition: glext.h:6722
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static LPOLESTR
Definition: stg_prop.c:27
REFCLSID clsid
Definition: msctf.c:82
IID CLSID
Definition: mstsclib_i.c:62
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by RunningObjectTableImpl_GetObject(), RunningObjectTableImpl_GetTimeOfLastChange(), RunningObjectTableImpl_IsRunning(), and RunningObjectTableImpl_Register().

◆ get_moniker_for_progid_display_name()

static HRESULT get_moniker_for_progid_display_name ( LPBC  pbc,
LPCOLESTR  szDisplayName,
LPDWORD  pchEaten,
LPMONIKER ppmk 
)
static

Definition at line 1054 of file moniker.c.

1058{
1059 CLSID clsid;
1060 HRESULT hr;
1061 LPWSTR progid;
1062 LPCWSTR start = szDisplayName;
1063 LPCWSTR end;
1064 int len;
1065 IMoniker *class_moniker;
1066
1067 if (*start == '@')
1068 start++;
1069
1070 /* find end delimiter */
1071 for (end = start; *end; end++)
1072 if (*end == ':')
1073 break;
1074
1075 len = end - start;
1076
1077 /* must start with '@' or have a ':' somewhere and mustn't be one character
1078 * long (since that looks like an absolute path) */
1079 if (((start == szDisplayName) && (*end == '\0')) || (len <= 1))
1080 return MK_E_SYNTAX;
1081
1082 progid = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
1083 if (progid)
1084 {
1085 memcpy(progid, start, len * sizeof(WCHAR));
1086 progid[len] = '\0';
1087 }
1090 if (FAILED(hr))
1091 return MK_E_SYNTAX;
1092
1093 hr = CreateClassMoniker(&clsid, &class_moniker);
1094 if (SUCCEEDED(hr))
1095 {
1096 IParseDisplayName *pdn;
1097 hr = IMoniker_BindToObject(class_moniker, pbc, NULL,
1098 &IID_IParseDisplayName, (void **)&pdn);
1099 /* fallback to using IClassFactory to get IParseDisplayName -
1100 * adsldp.dll depends on this */
1101 if (FAILED(hr))
1102 {
1103 IClassFactory *pcf;
1104 hr = IMoniker_BindToObject(class_moniker, pbc, NULL,
1105 &IID_IClassFactory, (void **)&pcf);
1106 if (SUCCEEDED(hr))
1107 {
1108 hr = IClassFactory_CreateInstance(pcf, NULL,
1110 (void **)&pdn);
1111 IClassFactory_Release(pcf);
1112 }
1113 }
1114 IMoniker_Release(class_moniker);
1115 if (SUCCEEDED(hr))
1116 {
1117 hr = IParseDisplayName_ParseDisplayName(pdn, pbc,
1118 (LPOLESTR)szDisplayName,
1119 pchEaten, ppmk);
1120 IParseDisplayName_Release(pdn);
1121 }
1122 }
1123 return hr;
1124}
const GUID IID_IClassFactory
HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, IMoniker **ppmk)
Definition: classmoniker.c:701
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2602
#define progid(str)
Definition: exdisp.idl:31
GLuint start
Definition: gl.h:1545
const GUID IID_IParseDisplayName
#define MK_E_SYNTAX
Definition: winerror.h:2785
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by MkParseDisplayName().

◆ GetClassFile()

HRESULT WINAPI GetClassFile ( LPCOLESTR  filePathName,
CLSID pclsid 
)

Definition at line 1213 of file moniker.c.

1214{
1215 IStorage *pstg=0;
1216 HRESULT res;
1217 int nbElm, length, i;
1218 LONG sizeProgId, ret;
1219 LPOLESTR *pathDec=0,absFile=0,progId=0;
1220 LPWSTR extension;
1221 static const WCHAR bkslashW[] = {'\\',0};
1222 static const WCHAR dotW[] = {'.',0};
1223
1224 TRACE("%s, %p\n", debugstr_w(filePathName), pclsid);
1225
1226 /* if the file contain a storage object the return the CLSID written by IStorage_SetClass method*/
1227 if((StgIsStorageFile(filePathName))==S_OK){
1228
1230
1231 if (SUCCEEDED(res)) {
1232 res=ReadClassStg(pstg,pclsid);
1233 IStorage_Release(pstg);
1234 }
1235
1236 return res;
1237 }
1238 /* If the file is not a storage object then attempt to match various bits in the file against a
1239 pattern in the registry. This case is not frequently used, so I present only the pseudocode for
1240 this case.
1241
1242 for(i=0;i<nFileTypes;i++)
1243
1244 for(i=0;j<nPatternsForType;j++){
1245
1246 PATTERN pat;
1247 HANDLE hFile;
1248
1249 pat=ReadPatternFromRegistry(i,j);
1250 hFile=CreateFileW(filePathName,,,,,,hFile);
1251 SetFilePosition(hFile,pat.offset);
1252 ReadFile(hFile,buf,pat.size,&r,NULL);
1253 if (memcmp(buf&pat.mask,pat.pattern.pat.size)==0){
1254
1255 *pclsid=ReadCLSIDFromRegistry(i);
1256 return S_OK;
1257 }
1258 }
1259 */
1260
1261 /* if the above strategies fail then search for the extension key in the registry */
1262
1263 /* get the last element (absolute file) in the path name */
1264 nbElm=FileMonikerImpl_DecomposePath(filePathName,&pathDec);
1265 absFile=pathDec[nbElm-1];
1266
1267 /* failed if the path represents a directory and not an absolute file name*/
1268 if (!wcscmp(absFile, bkslashW)) {
1269 CoTaskMemFree(pathDec);
1270 return MK_E_INVALIDEXTENSION;
1271 }
1272
1273 /* get the extension of the file */
1274 extension = NULL;
1275 length=lstrlenW(absFile);
1276 for(i = length-1; (i >= 0) && *(extension = &absFile[i]) != '.'; i--)
1277 /* nothing */;
1278
1279 if (!extension || !wcscmp(extension, dotW)) {
1280 CoTaskMemFree(pathDec);
1281 return MK_E_INVALIDEXTENSION;
1282 }
1283
1284 ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId);
1285 if (!ret) {
1286 /* get the progId associated to the extension */
1287 progId = CoTaskMemAlloc(sizeProgId);
1288 ret = RegQueryValueW(HKEY_CLASSES_ROOT, extension, progId, &sizeProgId);
1289 if (!ret)
1290 /* return the clsid associated to the progId */
1291 res = CLSIDFromProgID(progId, pclsid);
1292 else
1294 CoTaskMemFree(progId);
1295 }
1296 else
1298
1299 for(i=0; pathDec[i]!=NULL;i++)
1300 CoTaskMemFree(pathDec[i]);
1301 CoTaskMemFree(pathDec);
1302
1303 return res != S_OK ? MK_E_INVALIDEXTENSION : res;
1304}
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4259
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8755
HRESULT WINAPI ReadClassStg(IStorage *pstg, CLSID *pclsid)
Definition: storage32.c:9103
HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn)
Definition: storage32.c:9475
int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR **stringTable)
Definition: filemoniker.c:1023
GLuint res
Definition: glext.h:9613
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR dotW[]
Definition: directory.c:80
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922
#define STGM_READ
Definition: objbase.h:917
long LONG
Definition: pedump.c:60
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
int ret
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define MK_E_INVALIDEXTENSION
Definition: winerror.h:2787
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by CoGetInstanceFromFile(), FileMonikerImpl_BindToObject(), and UIINSERTOBJECTDLG_OnOpen().

◆ GetRunningObjectTable()

HRESULT WINAPI GetRunningObjectTable ( DWORD  reserved,
LPRUNNINGOBJECTTABLE pprot 
)

Definition at line 1035 of file moniker.c.

1036{
1037 IID riid=IID_IRunningObjectTable;
1038 HRESULT res;
1039
1040 TRACE("()\n");
1041
1042 if (reserved!=0)
1043 return E_UNEXPECTED;
1044
1046 return CO_E_NOTINITIALIZED;
1047
1048 res = IRunningObjectTable_QueryInterface(&runningObjectTableInstance->IRunningObjectTable_iface,
1049 &riid,(void**)pprot);
1050
1051 return res;
1052}
#define CO_E_NOTINITIALIZED
static RunningObjectTableImpl * runningObjectTableInstance
Definition: moniker.c:78
r reserved
Definition: btrfs.c:3006
IRunningObjectTable IRunningObjectTable_iface
Definition: moniker.c:71
#define E_UNEXPECTED
Definition: winerror.h:2456

Referenced by BindCtxImpl_GetRunningObjectTable(), GetActiveObject(), IHlinkBC_GetObject(), IHlinkBC_Register(), IHlinkBC_Revoke(), RegisterActiveObject(), RevokeActiveObject(), test_ROT(), and test_ROT_multiple_entries().

◆ impl_from_IEnumMoniker()

static EnumMonikerImpl * impl_from_IEnumMoniker ( IEnumMoniker iface)
inlinestatic

Definition at line 96 of file moniker.c.

97{
98 return CONTAINING_RECORD(iface, EnumMonikerImpl, IEnumMoniker_iface);
99}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by EnumMonikerImpl_AddRef(), EnumMonikerImpl_Clone(), EnumMonikerImpl_Next(), EnumMonikerImpl_QueryInterface(), EnumMonikerImpl_Release(), EnumMonikerImpl_Reset(), and EnumMonikerImpl_Skip().

◆ impl_from_IMarshal()

◆ impl_from_IRunningObjectTable()

◆ impl_from_IUnknown()

static MonikerMarshal * impl_from_IUnknown ( IUnknown iface)
inlinestatic

◆ MIDL_user_allocate()

void *__RPC_USER MIDL_user_allocate ( SIZE_T  size)

Definition at line 1691 of file moniker.c.

1692{
1693 return HeapAlloc(GetProcessHeap(), 0, size);
1694}

◆ MIDL_user_free()

void __RPC_USER MIDL_user_free ( void p)

Definition at line 1696 of file moniker.c.

1697{
1698 HeapFree(GetProcessHeap(), 0, p);
1699}
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by rot_entry_delete().

◆ MkParseDisplayName()

HRESULT WINAPI MkParseDisplayName ( LPBC  pbc,
LPCOLESTR  szDisplayName,
LPDWORD  pchEaten,
LPMONIKER ppmk 
)

Definition at line 1129 of file moniker.c.

1131{
1133 static const WCHAR wszClsidColon[] = {'c','l','s','i','d',':'};
1135 DWORD chEaten;
1136
1137 TRACE("(%p, %s, %p, %p)\n", pbc, debugstr_w(szDisplayName), pchEaten, ppmk);
1138
1139 if (!pbc || !IsValidInterface((LPUNKNOWN) pbc))
1140 return E_INVALIDARG;
1141
1142 if (!szDisplayName || !*szDisplayName)
1143 return E_INVALIDARG;
1144
1145 if (!pchEaten || !ppmk)
1146 return E_INVALIDARG;
1147
1148 *pchEaten = 0;
1149 *ppmk = NULL;
1150
1151 if (!_wcsnicmp(szDisplayName, wszClsidColon, ARRAY_SIZE(wszClsidColon)))
1152 {
1153 hr = ClassMoniker_CreateFromDisplayName(pbc, szDisplayName, &chEaten, &moniker);
1154 if (FAILED(hr) && (hr != MK_E_SYNTAX))
1155 return hr;
1156 }
1157 else
1158 {
1159 hr = get_moniker_for_progid_display_name(pbc, szDisplayName, &chEaten, &moniker);
1160 if (FAILED(hr) && (hr != MK_E_SYNTAX))
1161 return hr;
1162 }
1163
1164 if (FAILED(hr))
1165 {
1166 hr = FileMoniker_CreateFromDisplayName(pbc, szDisplayName, &chEaten, &moniker);
1167 if (FAILED(hr) && (hr != MK_E_SYNTAX))
1168 return hr;
1169 }
1170
1171 if (SUCCEEDED(hr))
1172 {
1173 while (TRUE)
1174 {
1175 IMoniker *next_moniker;
1176 *pchEaten += chEaten;
1177 szDisplayName += chEaten;
1178 if (!*szDisplayName)
1179 {
1180 *ppmk = moniker;
1181 return S_OK;
1182 }
1183 chEaten = 0;
1184 hr = IMoniker_ParseDisplayName(moniker, pbc, NULL,
1185 (LPOLESTR)szDisplayName, &chEaten,
1186 &next_moniker);
1187 IMoniker_Release(moniker);
1188 if (FAILED(hr))
1189 {
1190 *pchEaten = 0;
1191 break;
1192 }
1193 moniker = next_moniker;
1194 }
1195 }
1196
1197 return hr;
1198}
#define ARRAY_SIZE(a)
Definition: main.h:24
HRESULT ClassMoniker_CreateFromDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, IMoniker **ppmk)
Definition: classmoniker.c:725
static HRESULT get_moniker_for_progid_display_name(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, LPMONIKER *ppmk)
Definition: moniker.c:1054
HRESULT FileMoniker_CreateFromDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, IMoniker **ppmk)
Definition: filemoniker.c:1452
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI IsValidInterface(LPUNKNOWN punk)
Definition: ifs.c:555
static LPUNKNOWN
Definition: ndr_ole.c:49
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
Definition: main.c:40

Referenced by CoGetObject(), Global_GetObject(), HlinkParseDisplayName(), IHlink_fnSetStringReference(), MkParseDisplayNameEx(), and test_MkParseDisplayName().

◆ MonikerMarshal_AddRef()

static ULONG WINAPI MonikerMarshal_AddRef ( IMarshal iface)
static

Definition at line 1582 of file moniker.c.

1583{
1585 return IMoniker_AddRef(This->moniker);
1586}
static MonikerMarshal * impl_from_IMarshal(IMarshal *iface)
Definition: moniker.c:1534

◆ MonikerMarshal_Create()

HRESULT MonikerMarshal_Create ( IMoniker inner,
IUnknown **  outer 
)

Definition at line 1677 of file moniker.c.

1678{
1679 MonikerMarshal *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1680 if (!This) return E_OUTOFMEMORY;
1681
1682 This->IUnknown_iface.lpVtbl = &VT_MonikerMarshalInner;
1683 This->IMarshal_iface.lpVtbl = &VT_MonikerMarshal;
1684 This->ref = 1;
1685 This->moniker = inner;
1686
1687 *outer = &This->IUnknown_iface;
1688 return S_OK;
1689}
static const IUnknownVtbl VT_MonikerMarshalInner
Definition: moniker.c:1569
static const IMarshalVtbl VT_MonikerMarshal
Definition: moniker.c:1664

Referenced by AntiMonikerImpl_QueryInterface(), ClassMoniker_QueryInterface(), FileMonikerImpl_QueryInterface(), and ItemMonikerImpl_QueryInterface().

◆ MonikerMarshal_DisconnectObject()

static HRESULT WINAPI MonikerMarshal_DisconnectObject ( LPMARSHAL  iface,
DWORD  dwReserved 
)
static

Definition at line 1656 of file moniker.c.

1657{
1658 TRACE("()\n");
1659 /* can't disconnect a state-based marshal as nothing on server side to
1660 * disconnect from */
1661 return S_OK;
1662}

◆ MonikerMarshal_GetMarshalSizeMax()

static HRESULT WINAPI MonikerMarshal_GetMarshalSizeMax ( LPMARSHAL  iface,
REFIID  riid,
void pv,
DWORD  dwDestContext,
void pvDestContext,
DWORD  mshlflags,
DWORD pSize 
)
static

Definition at line 1606 of file moniker.c.

1609{
1611 HRESULT hr;
1613
1614 TRACE("(%s, %p, %x, %p, %x, %p)\n", debugstr_guid(riid), pv,
1615 dwDestContext, pvDestContext, mshlflags, pSize);
1616
1617 hr = IMoniker_GetSizeMax(This->moniker, &size);
1618 if (hr == S_OK)
1619 *pSize = (DWORD)size.QuadPart;
1620 return hr;
1621}
#define DWORD
Definition: nt_native.h:44

◆ MonikerMarshal_GetUnmarshalClass()

static HRESULT WINAPI MonikerMarshal_GetUnmarshalClass ( LPMARSHAL  iface,
REFIID  riid,
void pv,
DWORD  dwDestContext,
void pvDestContext,
DWORD  mshlflags,
CLSID pCid 
)
static

Definition at line 1594 of file moniker.c.

1597{
1599
1600 TRACE("(%s, %p, %x, %p, %x, %p)\n", debugstr_guid(riid), pv,
1601 dwDestContext, pvDestContext, mshlflags, pCid);
1602
1603 return IMoniker_GetClassID(This->moniker, pCid);
1604}

◆ MonikerMarshal_MarshalInterface()

static HRESULT WINAPI MonikerMarshal_MarshalInterface ( LPMARSHAL  iface,
IStream pStm,
REFIID  riid,
void pv,
DWORD  dwDestContext,
void pvDestContext,
DWORD  mshlflags 
)
static

Definition at line 1623 of file moniker.c.

1626{
1628
1629 TRACE("(%p, %s, %p, %x, %p, %x)\n", pStm, debugstr_guid(riid), pv,
1630 dwDestContext, pvDestContext, mshlflags);
1631
1632 return IMoniker_Save(This->moniker, pStm, FALSE);
1633}
#define FALSE
Definition: types.h:117

◆ MonikerMarshal_QueryInterface()

static HRESULT WINAPI MonikerMarshal_QueryInterface ( IMarshal iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1576 of file moniker.c.

1577{
1579 return IMoniker_QueryInterface(This->moniker, riid, ppv);
1580}
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ MonikerMarshal_Release()

static ULONG WINAPI MonikerMarshal_Release ( IMarshal iface)
static

Definition at line 1588 of file moniker.c.

1589{
1591 return IMoniker_Release(This->moniker);
1592}

◆ MonikerMarshal_ReleaseMarshalData()

static HRESULT WINAPI MonikerMarshal_ReleaseMarshalData ( LPMARSHAL  iface,
IStream pStm 
)
static

Definition at line 1648 of file moniker.c.

1649{
1650 TRACE("()\n");
1651 /* can't release a state-based marshal as nothing on server side to
1652 * release */
1653 return S_OK;
1654}

◆ MonikerMarshal_UnmarshalInterface()

static HRESULT WINAPI MonikerMarshal_UnmarshalInterface ( LPMARSHAL  iface,
IStream pStm,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1635 of file moniker.c.

1636{
1638 HRESULT hr;
1639
1640 TRACE("(%p, %s, %p)\n", pStm, debugstr_guid(riid), ppv);
1641
1642 hr = IMoniker_Load(This->moniker, pStm);
1643 if (hr == S_OK)
1644 hr = IMoniker_QueryInterface(This->moniker, riid, ppv);
1645 return hr;
1646}

◆ MonikerMarshalInner_AddRef()

static ULONG WINAPI MonikerMarshalInner_AddRef ( IUnknown iface)
static

Definition at line 1554 of file moniker.c.

1555{
1557 return InterlockedIncrement(&This->ref);
1558}
static MonikerMarshal * impl_from_IUnknown(IUnknown *iface)
Definition: moniker.c:1529

◆ MonikerMarshalInner_QueryInterface()

static HRESULT WINAPI MonikerMarshalInner_QueryInterface ( IUnknown iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1539 of file moniker.c.

1540{
1542 TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
1543 *ppv = NULL;
1544 if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IMarshal, riid))
1545 {
1546 *ppv = &This->IMarshal_iface;
1547 IMarshal_AddRef(&This->IMarshal_iface);
1548 return S_OK;
1549 }
1550 FIXME("No interface for %s\n", debugstr_guid(riid));
1551 return E_NOINTERFACE;
1552}
#define FIXME(fmt,...)
Definition: debug.h:111

◆ MonikerMarshalInner_Release()

static ULONG WINAPI MonikerMarshalInner_Release ( IUnknown iface)
static

Definition at line 1560 of file moniker.c.

1561{
1564
1565 if (!ref) HeapFree(GetProcessHeap(), 0, This);
1566 return ref;
1567}

◆ reduce_moniker()

static HRESULT reduce_moniker ( IMoniker pmk,
IBindCtx pbc,
IMoniker **  pmkReduced 
)
static

Definition at line 298 of file moniker.c.

299{
300 IBindCtx *pbcNew = NULL;
301 HRESULT hr;
302 if (!pbc)
303 {
304 hr = CreateBindCtx(0, &pbcNew);
305 if (FAILED(hr))
306 return hr;
307 pbc = pbcNew;
308 }
309 hr = IMoniker_Reduce(pmk, pbc, MKRREDUCE_ALL, NULL, pmkReduced);
310 if (FAILED(hr))
311 ERR("reducing moniker failed with error 0x%08x\n", hr);
312 if (pbcNew) IBindCtx_Release(pbcNew);
313 return hr;
314}

Referenced by RunningObjectTableImpl_GetObject(), RunningObjectTableImpl_GetTimeOfLastChange(), RunningObjectTableImpl_IsRunning(), and RunningObjectTableImpl_Register().

◆ rot_entry_delete()

static void rot_entry_delete ( struct rot_entry rot_entry)
static

Definition at line 188 of file moniker.c.

189{
190 if (rot_entry->cookie)
191 {
192 InterfaceData *object = NULL;
193 InterfaceData *moniker = NULL;
194 __TRY
195 {
197 &rot_entry->ctxt_handle, &object, &moniker);
198 }
200 {
201 }
203 MIDL_user_free(object);
204 if (moniker)
205 {
207 HRESULT hr;
209 if (hr == S_OK)
210 {
212 IStream_Release(stream);
213 }
214 }
216 }
217 if (rot_entry->object)
218 {
220 HRESULT hr;
222 if (hr == S_OK)
223 {
225 IStream_Release(stream);
226 }
227 }
231}
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
HRESULT WINAPI CoReleaseMarshalData(IStream *pStream)
Definition: marshal.c:2055
static IrotHandle get_irot_handle(void)
Definition: moniker.c:105
static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: moniker.c:52
void __RPC_USER MIDL_user_free(void *p)
Definition: moniker.c:1696
HRESULT __cdecl IrotRevoke(IrotHandle h, IrotCookie cookie, IrotContextHandle *ctxt_handle, PInterfaceData *obj, PInterfaceData *mk)
Definition: irotp.c:151
#define __EXCEPT(func)
Definition: exception.h:84
Definition: irotp.c:37
IrotContextHandle ctxt_handle
Definition: moniker.c:65
InterfaceData * object
Definition: irotp.c:39
MonikerComparisonData * moniker_data
Definition: irotp.c:41
DWORD cookie
Definition: irotp.c:42

Referenced by RunningObjectTableImpl_Destroy(), RunningObjectTableImpl_Register(), RunningObjectTableImpl_Release(), and RunningObjectTableImpl_Revoke().

◆ rpc_filter()

◆ RunningObjectTableImpl_AddRef()

static ULONG WINAPI RunningObjectTableImpl_AddRef ( IRunningObjectTable iface)
static

Definition at line 350 of file moniker.c.

351{
353
354 TRACE("(%p)\n",This);
355
356 return InterlockedIncrement(&This->ref);
357}
static RunningObjectTableImpl * impl_from_IRunningObjectTable(IRunningObjectTable *iface)
Definition: moniker.c:91

◆ RunningObjectTableImpl_Destroy()

static HRESULT RunningObjectTableImpl_Destroy ( void  )
static

Definition at line 363 of file moniker.c.

364{
365 struct list *cursor, *cursor2;
366 IrotHandle old_handle;
367
368 TRACE("()\n");
369
371 return E_INVALIDARG;
372
373 /* free the ROT table memory */
375 {
379 }
380
383
384 /* free the ROT structure memory */
387
388 old_handle = irot_handle;
390 if (old_handle)
391 RpcBindingFree(&old_handle);
392
393 return S_OK;
394}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:37
#define DEBUG_CLEAR_CRITSEC_NAME(cs)
static void rot_entry_delete(struct rot_entry *rot_entry)
Definition: moniker.c:188
const char cursor[]
Definition: icontest.c:13
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
struct list rot
Definition: moniker.c:74
CRITICAL_SECTION lock
Definition: moniker.c:75
struct list entry
Definition: irotp.c:38
#define LIST_ENTRY(type)
Definition: queue.h:175
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by RunningObjectTableImpl_UnInitialize().

◆ RunningObjectTableImpl_EnumRunning()

static HRESULT WINAPI RunningObjectTableImpl_EnumRunning ( IRunningObjectTable iface,
IEnumMoniker **  ppenumMoniker 
)
static

Definition at line 924 of file moniker.c.

926{
929 HRESULT hr;
930
931 TRACE("(%p, %p)\n", This, ppenumMoniker);
932
933 *ppenumMoniker = NULL;
934
935 while (TRUE)
936 {
937 __TRY
938 {
940 }
942 {
944 }
947 {
948 if (start_rpcss())
949 continue;
950 }
951 break;
952 }
953
954 if (SUCCEEDED(hr))
956 0, ppenumMoniker);
957
958 return hr;
959}
static struct regsvr_interface const interface_list[]
Definition: regsvr.c:477
static BOOL start_rpcss(void)
Definition: moniker.c:129
HRESULT __cdecl IrotEnumRunning(IrotHandle h, PInterfaceList *list)
Definition: irotp.c:317
#define GetExceptionCode()
Definition: seh.h:27
#define RPC_S_SERVER_UNAVAILABLE
Definition: winerror.h:1033

◆ RunningObjectTableImpl_GetObject()

static HRESULT WINAPI RunningObjectTableImpl_GetObject ( IRunningObjectTable iface,
IMoniker pmkObjectName,
IUnknown **  ppunkObject 
)
static

Definition at line 705 of file moniker.c.

707{
709 MonikerComparisonData *moniker_data;
710 InterfaceData *object = NULL;
711 IrotCookie cookie;
712 HRESULT hr;
713 struct rot_entry *rot_entry;
714
715 TRACE("(%p,%p,%p)\n",This,pmkObjectName,ppunkObject);
716
717 if (ppunkObject == NULL)
718 return E_POINTER;
719
720 *ppunkObject = NULL;
721
722 hr = reduce_moniker(pmkObjectName, NULL, &pmkObjectName);
723 if (FAILED(hr))
724 return hr;
726 IMoniker_Release(pmkObjectName);
727 if (hr != S_OK)
728 return hr;
729
732 {
735 {
736 IStream *pStream;
738 if (hr == S_OK)
739 {
740 hr = CoUnmarshalInterface(pStream, &IID_IUnknown, (void **)ppunkObject);
741 IStream_Release(pStream);
742 }
743
746
747 return hr;
748 }
749 }
751
752 TRACE("moniker unavailable locally, calling SCM\n");
753
754 while (TRUE)
755 {
756 __TRY
757 {
759 }
761 {
763 }
766 {
767 if (start_rpcss())
768 continue;
769 }
770 break;
771 }
772
773 if (SUCCEEDED(hr))
774 {
775 IStream *pStream;
776 hr = create_stream_on_mip_ro(object, &pStream);
777 if (hr == S_OK)
778 {
779 hr = CoUnmarshalInterface(pStream, &IID_IUnknown, (void **)ppunkObject);
780 IStream_Release(pStream);
781 }
782 }
783 else
784 WARN("Moniker unavailable, IrotGetObject returned 0x%08x\n", hr);
785
787
788 return hr;
789}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define WARN(fmt,...)
Definition: debug.h:112
static HRESULT get_moniker_comparison_data(IMoniker *pMoniker, MonikerComparisonData **moniker_data)
Definition: moniker.c:234
static HRESULT reduce_moniker(IMoniker *pmk, IBindCtx *pbc, IMoniker **pmkReduced)
Definition: moniker.c:298
HRESULT __cdecl IrotGetObject(IrotHandle h, const MonikerComparisonData *moniker_data, PInterfaceData *obj, IrotCookie *cookie)
Definition: irotp.c:223
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
Definition: cookie.c:34
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define E_POINTER
Definition: winerror.h:2365

◆ RunningObjectTableImpl_GetTimeOfLastChange()

static HRESULT WINAPI RunningObjectTableImpl_GetTimeOfLastChange ( IRunningObjectTable iface,
IMoniker pmkObjectName,
FILETIME pfiletime 
)
static

Definition at line 853 of file moniker.c.

855{
858 MonikerComparisonData *moniker_data;
859 const struct rot_entry *rot_entry;
860
861 TRACE("(%p,%p,%p)\n",This,pmkObjectName,pfiletime);
862
863 if (pmkObjectName==NULL || pfiletime==NULL)
864 return E_INVALIDARG;
865
866 hr = reduce_moniker(pmkObjectName, NULL, &pmkObjectName);
867 if (FAILED(hr))
868 return hr;
870 IMoniker_Release(pmkObjectName);
871 if (hr != S_OK)
872 return hr;
873
875
877 LIST_FOR_EACH_ENTRY(rot_entry, &This->rot, const struct rot_entry, entry)
878 {
881 {
882 *pfiletime = rot_entry->last_modified;
883 hr = S_OK;
884 break;
885 }
886 }
888
889 if (hr != S_OK)
890 {
891 while (TRUE)
892 {
893 __TRY
894 {
896 }
898 {
900 }
903 {
904 if (start_rpcss())
905 continue;
906 }
907 break;
908 }
909 }
910
912
913 TRACE("-- 0x%08x\n", hr);
914 return hr;
915}
HRESULT __cdecl IrotGetTimeOfLastChange(IrotHandle h, const MonikerComparisonData *moniker_data, FILETIME *time)
Definition: irotp.c:289
FILETIME last_modified
Definition: irotp.c:43
#define MK_E_UNAVAILABLE
Definition: winerror.h:2784

◆ RunningObjectTableImpl_Initialize()

HRESULT WINAPI RunningObjectTableImpl_Initialize ( void  )

Definition at line 979 of file moniker.c.

980{
981 TRACE("\n");
982
983 /* create the unique instance of the RunningObjectTableImpl structure */
985
987 return E_OUTOFMEMORY;
988
989 /* initialize the virtual table function */
991
992 /* the initial reference is set to "1" so that it isn't destroyed after its
993 * first use until the process is destroyed, as the running object table is
994 * a process-wide cache of a global table */
996
999 DEBUG_SET_CRITSEC_NAME(&runningObjectTableInstance->lock, "RunningObjectTableImpl.lock");
1000
1001 return S_OK;
1002}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define DEBUG_SET_CRITSEC_NAME(cs, name)
static const IRunningObjectTableVtbl VT_RunningObjectTableImpl
Definition: moniker.c:962
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751

Referenced by CoInitializeEx().

◆ RunningObjectTableImpl_IsRunning()

static HRESULT WINAPI RunningObjectTableImpl_IsRunning ( IRunningObjectTable iface,
IMoniker pmkObjectName 
)
static

Definition at line 640 of file moniker.c.

641{
643 MonikerComparisonData *moniker_data;
644 HRESULT hr;
645 const struct rot_entry *rot_entry;
646
647 TRACE("(%p,%p)\n",This,pmkObjectName);
648
649 hr = reduce_moniker(pmkObjectName, NULL, &pmkObjectName);
650 if (FAILED(hr))
651 return hr;
653 IMoniker_Release(pmkObjectName);
654 if (hr != S_OK)
655 return hr;
656
657 hr = S_FALSE;
659 LIST_FOR_EACH_ENTRY(rot_entry, &This->rot, const struct rot_entry, entry)
660 {
663 {
664 hr = S_OK;
665 break;
666 }
667 }
669
670 if (hr == S_FALSE)
671 {
672 while (TRUE)
673 {
674 __TRY
675 {
677 }
679 {
681 }
684 {
685 if (start_rpcss())
686 continue;
687 }
688 break;
689 }
690 }
691
693
694 return hr;
695}
HRESULT __cdecl IrotIsRunning(IrotHandle h, const MonikerComparisonData *data)
Definition: irotp.c:198

◆ RunningObjectTableImpl_NoteChangeTime()

static HRESULT WINAPI RunningObjectTableImpl_NoteChangeTime ( IRunningObjectTable iface,
DWORD  dwRegister,
FILETIME pfiletime 
)
static

Definition at line 799 of file moniker.c.

801{
803 struct rot_entry *rot_entry;
805
806 TRACE("(%p,%d,%p)\n",This,dwRegister,pfiletime);
807
810 {
811 if (rot_entry->cookie == dwRegister)
812 {
813 rot_entry->last_modified = *pfiletime;
815
816 while (TRUE)
817 {
818 __TRY
819 {
820 hr = IrotNoteChangeTime(get_irot_handle(), dwRegister, pfiletime);
821 }
823 {
825 }
828 {
829 if (start_rpcss())
830 continue;
831 }
832 break;
833 }
834
835 goto done;
836 }
837 }
839
840done:
841 TRACE("-- 0x08%x\n", hr);
842 return hr;
843}
HRESULT __cdecl IrotNoteChangeTime(IrotHandle h, IrotCookie cookie, const FILETIME *last_modified_time)
Definition: irotp.c:265

◆ RunningObjectTableImpl_QueryInterface()

static HRESULT WINAPI RunningObjectTableImpl_QueryInterface ( IRunningObjectTable iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 320 of file moniker.c.

322{
324
325 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
326
327 /* validate arguments */
328
329 if (ppvObject==0)
330 return E_INVALIDARG;
331
332 *ppvObject = 0;
333
335 IsEqualIID(&IID_IRunningObjectTable, riid))
336 *ppvObject = &This->IRunningObjectTable_iface;
337
338 if ((*ppvObject)==0)
339 return E_NOINTERFACE;
340
341 IRunningObjectTable_AddRef(iface);
342
343 return S_OK;
344}

◆ RunningObjectTableImpl_Register()

static HRESULT WINAPI RunningObjectTableImpl_Register ( IRunningObjectTable iface,
DWORD  grfFlags,
IUnknown punkObject,
IMoniker pmkObjectName,
DWORD pdwRegister 
)
static

Definition at line 437 of file moniker.c.

439{
441 struct rot_entry *rot_entry;
442 HRESULT hr = S_OK;
443 IStream *pStream = NULL;
444 DWORD mshlflags;
445 IBindCtx *pbc;
446 InterfaceData *moniker = NULL;
447
448 TRACE("(%p,%d,%p,%p,%p)\n",This,grfFlags,punkObject,pmkObjectName,pdwRegister);
449
450 if (grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT))
451 {
452 ERR("Invalid grfFlags: 0x%08x\n", grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT));
453 return E_INVALIDARG;
454 }
455
456 if (punkObject==NULL || pmkObjectName==NULL || pdwRegister==NULL)
457 return E_INVALIDARG;
458
460 if (!rot_entry)
461 return E_OUTOFMEMORY;
462
463 /* marshal object */
464 hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
465 if (hr != S_OK)
466 {
468 return hr;
469 }
470 mshlflags = (grfFlags & ROTFLAGS_REGISTRATIONKEEPSALIVE) ? MSHLFLAGS_TABLESTRONG : MSHLFLAGS_TABLEWEAK;
471 hr = CoMarshalInterface(pStream, &IID_IUnknown, punkObject, MSHCTX_LOCAL | MSHCTX_NOSHAREDMEM, NULL, mshlflags);
472 /* FIXME: a cleaner way would be to create an IStream class that writes
473 * directly to an MInterfacePointer */
474 if (hr == S_OK)
475 {
476 HGLOBAL hglobal;
477 hr = GetHGlobalFromStream(pStream, &hglobal);
478 if (hr == S_OK)
479 {
480 SIZE_T size = GlobalSize(hglobal);
481 const void *pv = GlobalLock(hglobal);
482 rot_entry->object = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MInterfacePointer, abData[size]));
483 rot_entry->object->ulCntData = size;
484 memcpy(rot_entry->object->abData, pv, size);
485 GlobalUnlock(hglobal);
486 }
487 }
488 IStream_Release(pStream);
489 if (hr != S_OK)
490 {
492 return hr;
493 }
494
495 hr = CreateBindCtx(0, &pbc);
496 if (FAILED(hr))
497 {
499 return hr;
500 }
501
502 hr = reduce_moniker(pmkObjectName, pbc, &pmkObjectName);
503 if (FAILED(hr))
504 {
506 IBindCtx_Release(pbc);
507 return hr;
508 }
509
510 hr = IMoniker_GetTimeOfLastChange(pmkObjectName, pbc, NULL,
512 IBindCtx_Release(pbc);
513 if (FAILED(hr))
514 {
516 hr = S_OK;
517 }
518
519 hr = get_moniker_comparison_data(pmkObjectName,
521 if (hr != S_OK)
522 {
524 IMoniker_Release(pmkObjectName);
525 return hr;
526 }
527
528 hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
529 if (hr != S_OK)
530 {
532 IMoniker_Release(pmkObjectName);
533 return hr;
534 }
535 /* marshal moniker */
536 hr = CoMarshalInterface(pStream, &IID_IMoniker, (IUnknown *)pmkObjectName,
537 MSHCTX_LOCAL | MSHCTX_NOSHAREDMEM, NULL, MSHLFLAGS_TABLESTRONG);
538 /* FIXME: a cleaner way would be to create an IStream class that writes
539 * directly to an MInterfacePointer */
540 if (hr == S_OK)
541 {
542 HGLOBAL hglobal;
543 hr = GetHGlobalFromStream(pStream, &hglobal);
544 if (hr == S_OK)
545 {
546 SIZE_T size = GlobalSize(hglobal);
547 const void *pv = GlobalLock(hglobal);
548 moniker = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[size]));
549 moniker->ulCntData = size;
550 memcpy(moniker->abData, pv, size);
551 GlobalUnlock(hglobal);
552 }
553 }
554 IStream_Release(pStream);
555 IMoniker_Release(pmkObjectName);
556 if (hr != S_OK)
557 {
560 return hr;
561 }
562
563
564 while (TRUE)
565 {
566 __TRY
567 {
570 &rot_entry->last_modified, grfFlags,
572 }
574 {
576 }
579 {
580 if (start_rpcss())
581 continue;
582 }
583 break;
584 }
586 if (FAILED(hr))
587 {
589 return hr;
590 }
591
592 /* gives a registration identifier to the registered object*/
593 *pdwRegister = rot_entry->cookie;
594
598
599 return hr;
600}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
HRESULT WINAPI CoFileTimeNow(FILETIME *lpFileTime)
Definition: compobj.c:3717
HRESULT WINAPI GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags)
Definition: marshal.c:1876
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
HRESULT __cdecl IrotRegister(IrotHandle h, const MonikerComparisonData *data, const InterfaceData *obj, const InterfaceData *mk, const FILETIME *time, DWORD grfFlags, IrotCookie *cookie, IrotContextHandle *ctxt_handle)
Definition: irotp.c:71

◆ RunningObjectTableImpl_Release()

static ULONG WINAPI RunningObjectTableImpl_Release ( IRunningObjectTable iface)
static

Definition at line 400 of file moniker.c.

401{
403 ULONG ref;
404
405 TRACE("(%p)\n",This);
406
408
409 /* uninitialize ROT structure if there are no more references to it */
410 if (ref == 0)
411 {
412 struct list *cursor, *cursor2;
413 LIST_FOR_EACH_SAFE(cursor, cursor2, &This->rot)
414 {
418 }
419 /* RunningObjectTable data structure will be not destroyed here ! the destruction will be done only
420 * when RunningObjectTableImpl_UnInitialize function is called
421 */
422 }
423
424 return ref;
425}

Referenced by RunningObjectTableImpl_UnInitialize().

◆ RunningObjectTableImpl_Revoke()

static HRESULT WINAPI RunningObjectTableImpl_Revoke ( IRunningObjectTable iface,
DWORD  dwRegister 
)
static

Definition at line 609 of file moniker.c.

610{
612 struct rot_entry *rot_entry;
613
614 TRACE("(%p,%d)\n",This,dwRegister);
615
618 {
619 if (rot_entry->cookie == dwRegister)
620 {
623
625 return S_OK;
626 }
627 }
629
630 return E_INVALIDARG;
631}

◆ RunningObjectTableImpl_UnInitialize()

HRESULT WINAPI RunningObjectTableImpl_UnInitialize ( void  )

Definition at line 1007 of file moniker.c.

1008{
1009 TRACE("\n");
1010
1012 return E_POINTER;
1013
1015
1017
1018 return S_OK;
1019}
static HRESULT RunningObjectTableImpl_Destroy(void)
Definition: moniker.c:363
static ULONG WINAPI RunningObjectTableImpl_Release(IRunningObjectTable *iface)
Definition: moniker.c:400

Referenced by CoUninitialize().

◆ start_rpcss()

static BOOL start_rpcss ( void  )
static

Definition at line 129 of file moniker.c.

130{
131 static const WCHAR rpcssW[] = {'R','p','c','S','s',0};
132 SC_HANDLE scm, service;
134 BOOL ret = FALSE;
135
136 TRACE("\n");
137
138 if (!(scm = OpenSCManagerW( NULL, NULL, 0 )))
139 {
140 ERR( "failed to open service manager\n" );
141 return FALSE;
142 }
143 if (!(service = OpenServiceW( scm, rpcssW, SERVICE_START | SERVICE_QUERY_STATUS )))
144 {
145 ERR( "failed to open RpcSs service\n" );
146 CloseServiceHandle( scm );
147 return FALSE;
148 }
150 {
151 ULONGLONG start_time = GetTickCount64();
152 do
153 {
154 DWORD dummy;
155
157 (BYTE *)&status, sizeof(status), &dummy ))
158 break;
159 if (status.dwCurrentState == SERVICE_RUNNING)
160 {
161 ret = TRUE;
162 break;
163 }
164 if (GetTickCount64() - start_time > 30000) break;
165 Sleep( 100 );
166
167 } while (status.dwCurrentState == SERVICE_START_PENDING);
168
169 if (status.dwCurrentState != SERVICE_RUNNING)
170 WARN( "RpcSs failed to start %u\n", status.dwCurrentState );
171 }
172 else ERR( "failed to start RpcSs service\n" );
173
174 CloseServiceHandle( service );
175 CloseServiceHandle( scm );
176 return ret;
177}
ULONGLONG WINAPI GetTickCount64(VOID)
Definition: GetTickCount64.c:9
unsigned int BOOL
Definition: ntddk_ex.h:94
static WCHAR rpcssW[]
Definition: rpcss_main.c:36
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2016
BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
Definition: scm.c:2835
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2108
BOOL WINAPI StartServiceW(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors)
Definition: scm.c:2928
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
uint64_t ULONGLONG
Definition: typedefs.h:67
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define ERROR_SERVICE_ALREADY_RUNNING
Definition: winerror.h:607
#define SERVICE_START
Definition: winsvc.h:57
#define SERVICE_QUERY_STATUS
Definition: winsvc.h:55
@ SC_STATUS_PROCESS_INFO
Definition: winsvc.h:119
#define SERVICE_START_PENDING
Definition: winsvc.h:22
#define SERVICE_RUNNING
Definition: winsvc.h:24
unsigned char BYTE
Definition: xxhash.c:193

Referenced by RunningObjectTableImpl_EnumRunning(), RunningObjectTableImpl_GetObject(), RunningObjectTableImpl_GetTimeOfLastChange(), RunningObjectTableImpl_IsRunning(), RunningObjectTableImpl_NoteChangeTime(), and RunningObjectTableImpl_Register().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ irot_handle

IrotHandle irot_handle
static

Definition at line 79 of file moniker.c.

Referenced by get_irot_handle(), and RunningObjectTableImpl_Destroy().

◆ runningObjectTableInstance

◆ VT_EnumMonikerImpl

const IEnumMonikerVtbl VT_EnumMonikerImpl
static
Initial value:
=
{
}
static HRESULT WINAPI EnumMonikerImpl_Reset(IEnumMoniker *iface)
Definition: moniker.c:1424
static ULONG WINAPI EnumMonikerImpl_Release(IEnumMoniker *iface)
Definition: moniker.c:1345
static HRESULT WINAPI EnumMonikerImpl_Clone(IEnumMoniker *iface, IEnumMoniker **ppenum)
Definition: moniker.c:1438
static HRESULT WINAPI EnumMonikerImpl_Skip(IEnumMoniker *iface, ULONG celt)
Definition: moniker.c:1407
static HRESULT WINAPI EnumMonikerImpl_Next(IEnumMoniker *iface, ULONG celt, IMoniker **rgelt, ULONG *pceltFetched)
Definition: moniker.c:1372
static ULONG WINAPI EnumMonikerImpl_AddRef(IEnumMoniker *iface)
Definition: moniker.c:1333
static HRESULT WINAPI EnumMonikerImpl_QueryInterface(IEnumMoniker *iface, REFIID riid, void **ppvObject)
Definition: moniker.c:1309

Definition at line 1473 of file moniker.c.

Referenced by EnumMonikerImpl_CreateEnumROTMoniker().

◆ VT_MonikerMarshal

const IMarshalVtbl VT_MonikerMarshal
static
Initial value:
=
{
}
static HRESULT WINAPI MonikerMarshal_MarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags)
Definition: moniker.c:1623
static HRESULT WINAPI MonikerMarshal_DisconnectObject(LPMARSHAL iface, DWORD dwReserved)
Definition: moniker.c:1656
static HRESULT WINAPI MonikerMarshal_GetMarshalSizeMax(LPMARSHAL iface, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, DWORD *pSize)
Definition: moniker.c:1606
static ULONG WINAPI MonikerMarshal_AddRef(IMarshal *iface)
Definition: moniker.c:1582
static HRESULT WINAPI MonikerMarshal_GetUnmarshalClass(LPMARSHAL iface, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *pCid)
Definition: moniker.c:1594
static HRESULT WINAPI MonikerMarshal_QueryInterface(IMarshal *iface, REFIID riid, LPVOID *ppv)
Definition: moniker.c:1576
static ULONG WINAPI MonikerMarshal_Release(IMarshal *iface)
Definition: moniker.c:1588
static HRESULT WINAPI MonikerMarshal_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm)
Definition: moniker.c:1648
static HRESULT WINAPI MonikerMarshal_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void **ppv)
Definition: moniker.c:1635

Definition at line 1664 of file moniker.c.

Referenced by MonikerMarshal_Create().

◆ VT_MonikerMarshalInner

const IUnknownVtbl VT_MonikerMarshalInner
static
Initial value:
=
{
}
static HRESULT WINAPI MonikerMarshalInner_QueryInterface(IUnknown *iface, REFIID riid, LPVOID *ppv)
Definition: moniker.c:1539
static ULONG WINAPI MonikerMarshalInner_Release(IUnknown *iface)
Definition: moniker.c:1560
static ULONG WINAPI MonikerMarshalInner_AddRef(IUnknown *iface)
Definition: moniker.c:1554

Definition at line 1569 of file moniker.c.

Referenced by MonikerMarshal_Create().

◆ VT_RunningObjectTableImpl

const IRunningObjectTableVtbl VT_RunningObjectTableImpl
static
Initial value:
=
{
}
static HRESULT WINAPI RunningObjectTableImpl_QueryInterface(IRunningObjectTable *iface, REFIID riid, void **ppvObject)
Definition: moniker.c:320
static HRESULT WINAPI RunningObjectTableImpl_GetObject(IRunningObjectTable *iface, IMoniker *pmkObjectName, IUnknown **ppunkObject)
Definition: moniker.c:705
static HRESULT WINAPI RunningObjectTableImpl_EnumRunning(IRunningObjectTable *iface, IEnumMoniker **ppenumMoniker)
Definition: moniker.c:924
static HRESULT WINAPI RunningObjectTableImpl_Revoke(IRunningObjectTable *iface, DWORD dwRegister)
Definition: moniker.c:609
static HRESULT WINAPI RunningObjectTableImpl_NoteChangeTime(IRunningObjectTable *iface, DWORD dwRegister, FILETIME *pfiletime)
Definition: moniker.c:799
static HRESULT WINAPI RunningObjectTableImpl_Register(IRunningObjectTable *iface, DWORD grfFlags, IUnknown *punkObject, IMoniker *pmkObjectName, DWORD *pdwRegister)
Definition: moniker.c:437
static ULONG WINAPI RunningObjectTableImpl_AddRef(IRunningObjectTable *iface)
Definition: moniker.c:350
static HRESULT WINAPI RunningObjectTableImpl_GetTimeOfLastChange(IRunningObjectTable *iface, IMoniker *pmkObjectName, FILETIME *pfiletime)
Definition: moniker.c:853
static HRESULT WINAPI RunningObjectTableImpl_IsRunning(IRunningObjectTable *iface, IMoniker *pmkObjectName)
Definition: moniker.c:640

Definition at line 962 of file moniker.c.

Referenced by RunningObjectTableImpl_Initialize().