50#define MAX_COMPARISON_DATA 2048
111 IrotHandle new_handle;
112 unsigned short ncacn_np[] = IROT_PROTSEQ;
113 unsigned short endpoint[] = IROT_ENDPOINT;
131 static const WCHAR rpcssW[] = {
'R',
'p',
'c',
'S',
's',0};
132 SC_HANDLE scm, service;
140 ERR(
"failed to open service manager\n" );
145 ERR(
"failed to open RpcSs service\n" );
170 WARN(
"RpcSs failed to start %u\n",
status.dwCurrentState );
172 else ERR(
"failed to start RpcSs service\n" );
183 memcpy(pv, mip->abData, mip->ulCntData);
192 InterfaceData *
object =
NULL;
238 hr = IMoniker_QueryInterface(pMoniker, &IID_IROTData, (
void *)&pROTData);
245 IROTData_Release(pROTData);
248 hr = IROTData_GetComparisonData(pROTData, (*moniker_data)->abData,
size, &
size);
249 IROTData_Release(pROTData);
252 ERR(
"Failed to copy comparison data into buffer, hr = 0x%08x\n",
hr);
256 (*moniker_data)->ulCntData =
size;
265 TRACE(
"generating comparison data from display name\n");
270 hr = IMoniker_GetDisplayName(pMoniker, pbc,
NULL, &pszDisplayName);
271 IBindCtx_Release(pbc);
274 hr = IMoniker_GetClassID(pMoniker, &
clsid);
289 (*moniker_data)->ulCntData =
sizeof(
CLSID) + (
len+1)*
sizeof(
WCHAR);
309 hr = IMoniker_Reduce(pmk, pbc, MKRREDUCE_ALL,
NULL, pmkReduced);
311 ERR(
"reducing moniker failed with error 0x%08x\n",
hr);
312 if (pbcNew) IBindCtx_Release(pbcNew);
341 IRunningObjectTable_AddRef(iface);
366 IrotHandle old_handle;
448 TRACE(
"(%p,%d,%p,%p,%p)\n",
This,grfFlags,punkObject,pmkObjectName,pdwRegister);
450 if (grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT))
452 ERR(
"Invalid grfFlags: 0x%08x\n", grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT));
456 if (punkObject==
NULL || pmkObjectName==
NULL || pdwRegister==
NULL)
470 mshlflags = (grfFlags & ROTFLAGS_REGISTRATIONKEEPSALIVE) ? MSHLFLAGS_TABLESTRONG : MSHLFLAGS_TABLEWEAK;
488 IStream_Release(pStream);
506 IBindCtx_Release(pbc);
510 hr = IMoniker_GetTimeOfLastChange(pmkObjectName, pbc,
NULL,
512 IBindCtx_Release(pbc);
524 IMoniker_Release(pmkObjectName);
532 IMoniker_Release(pmkObjectName);
537 MSHCTX_LOCAL | MSHCTX_NOSHAREDMEM,
NULL, MSHLFLAGS_TABLESTRONG);
554 IStream_Release(pStream);
555 IMoniker_Release(pmkObjectName);
653 IMoniker_Release(pmkObjectName);
710 InterfaceData *
object =
NULL;
715 TRACE(
"(%p,%p,%p)\n",
This,pmkObjectName,ppunkObject);
717 if (ppunkObject ==
NULL)
726 IMoniker_Release(pmkObjectName);
741 IStream_Release(pStream);
752 TRACE(
"moniker unavailable locally, calling SCM\n");
780 IStream_Release(pStream);
784 WARN(
"Moniker unavailable, IrotGetObject returned 0x%08x\n",
hr);
806 TRACE(
"(%p,%d,%p)\n",
This,dwRegister,pfiletime);
861 TRACE(
"(%p,%p,%p)\n",
This,pmkObjectName,pfiletime);
863 if (pmkObjectName==
NULL || pfiletime==
NULL)
870 IMoniker_Release(pmkObjectName);
931 TRACE(
"(%p, %p)\n",
This, ppenumMoniker);
933 *ppenumMoniker =
NULL;
1037 IID riid=IID_IRunningObjectTable;
1049 &
riid,(
void**)pprot);
1055 LPCOLESTR szDisplayName,
1079 if (((
start == szDisplayName) && (*
end ==
'\0')) || (
len <= 1))
1097 hr = IMoniker_BindToObject(class_moniker, pbc,
NULL,
1104 hr = IMoniker_BindToObject(class_moniker, pbc,
NULL,
1108 hr = IClassFactory_CreateInstance(pcf,
NULL,
1111 IClassFactory_Release(pcf);
1114 IMoniker_Release(class_moniker);
1117 hr = IParseDisplayName_ParseDisplayName(pdn, pbc,
1120 IParseDisplayName_Release(pdn);
1133 static const WCHAR wszClsidColon[] = {
'c',
'l',
's',
'i',
'd',
':'};
1137 TRACE(
"(%p, %s, %p, %p)\n", pbc,
debugstr_w(szDisplayName), pchEaten, ppmk);
1142 if (!szDisplayName || !*szDisplayName)
1145 if (!pchEaten || !ppmk)
1176 *pchEaten += chEaten;
1177 szDisplayName += chEaten;
1178 if (!*szDisplayName)
1219 LPOLESTR *pathDec=0,absFile=0,progId=0;
1221 static const WCHAR bkslashW[] = {
'\\',0};
1233 IStorage_Release(pstg);
1265 absFile=pathDec[nbElm-1];
1268 if (!
wcscmp(absFile, bkslashW)) {
1276 for(
i =
length-1; (
i >= 0) && *(extension = &absFile[
i]) !=
'.';
i--)
1279 if (!extension || !
wcscmp(extension,
dotW)) {
1299 for(
i=0; pathDec[
i]!=
NULL;
i++)
1326 IEnumMoniker_AddRef(iface);
1361 for (
i = 0;
i <
This->moniker_list->size;
i++)
1378 TRACE(
"(%p) TabCurrentPos %d Tablastindx %d\n",
This,
This->pos,
This->moniker_list->size);
1381 for(
i = 0; (
This->pos <
This->moniker_list->size) && (
i < celt);
i++)
1391 if (pceltFetched !=
NULL)
1413 if (
This->pos + celt >=
This->moniker_list->size)
1452 moniker_list->size =
This->moniker_list->size;
1453 for (
i = 0;
i <
This->moniker_list->size;
i++)
1457 if (!moniker_list->interfaces[
i])
1460 for (
i = 0;
i <
end;
i++)
1465 memcpy(moniker_list->interfaces[
i],
This->moniker_list->interfaces[
i],
size);
1508 This->pos = current_pos;
1509 This->moniker_list = moniker_list;
1511 *ppenumMoniker = &
This->IEnumMoniker_iface;
1547 IMarshal_AddRef(&
This->IMarshal_iface);
1579 return IMoniker_QueryInterface(
This->moniker,
riid,
ppv);
1585 return IMoniker_AddRef(
This->moniker);
1591 return IMoniker_Release(
This->moniker);
1596 void* pvDestContext,
DWORD mshlflags,
CLSID* pCid)
1601 dwDestContext, pvDestContext, mshlflags, pCid);
1603 return IMoniker_GetClassID(
This->moniker, pCid);
1608 void* pvDestContext,
DWORD mshlflags,
DWORD* pSize)
1615 dwDestContext, pvDestContext, mshlflags, pSize);
1617 hr = IMoniker_GetSizeMax(
This->moniker, &
size);
1625 void* pvDestContext,
DWORD mshlflags)
1630 dwDestContext, pvDestContext, mshlflags);
1632 return IMoniker_Save(
This->moniker, pStm,
FALSE);
1642 hr = IMoniker_Load(
This->moniker, pStm);
1685 This->moniker = inner;
1687 *outer = &
This->IUnknown_iface;
#define CO_E_NOTINITIALIZED
ULONGLONG WINAPI GetTickCount64(VOID)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
const GUID IID_IClassFactory
HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, IMoniker **ppmk)
HRESULT ClassMoniker_CreateFromDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, IMoniker **ppmk)
#define DEBUG_SET_CRITSEC_NAME(cs, name)
#define DEBUG_CLEAR_CRITSEC_NAME(cs)
static struct regsvr_interface const interface_list[]
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
#define HeapFree(x, y, z)
HRESULT WINAPI CoFileTimeNow(FILETIME *lpFileTime)
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
HRESULT WINAPI GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HRESULT WINAPI CoReleaseMarshalData(IStream *pStream)
HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv)
HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags)
static HRESULT WINAPI MonikerMarshal_MarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags)
static HRESULT WINAPI RunningObjectTableImpl_QueryInterface(IRunningObjectTable *iface, REFIID riid, void **ppvObject)
HRESULT WINAPI GetClassFile(LPCOLESTR filePathName, CLSID *pclsid)
static HRESULT WINAPI MonikerMarshal_DisconnectObject(LPMARSHAL iface, DWORD dwReserved)
static HRESULT WINAPI RunningObjectTableImpl_GetObject(IRunningObjectTable *iface, IMoniker *pmkObjectName, IUnknown **ppunkObject)
#define MAX_COMPARISON_DATA
HRESULT WINAPI RunningObjectTableImpl_UnInitialize(void)
static HRESULT WINAPI EnumMonikerImpl_Reset(IEnumMoniker *iface)
static HRESULT get_moniker_comparison_data(IMoniker *pMoniker, MonikerComparisonData **moniker_data)
static HRESULT WINAPI MonikerMarshalInner_QueryInterface(IUnknown *iface, REFIID riid, LPVOID *ppv)
static HRESULT reduce_moniker(IMoniker *pmk, IBindCtx *pbc, IMoniker **pmkReduced)
static EnumMonikerImpl * impl_from_IEnumMoniker(IEnumMoniker *iface)
static ULONG WINAPI EnumMonikerImpl_Release(IEnumMoniker *iface)
static RunningObjectTableImpl * runningObjectTableInstance
static HRESULT WINAPI EnumMonikerImpl_Clone(IEnumMoniker *iface, IEnumMoniker **ppenum)
static IrotHandle get_irot_handle(void)
HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, LPMONIKER *ppmk)
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
HRESULT WINAPI RunningObjectTableImpl_Initialize(void)
static void rot_entry_delete(struct rot_entry *rot_entry)
static HRESULT WINAPI EnumMonikerImpl_Skip(IEnumMoniker *iface, ULONG celt)
static IrotHandle irot_handle
static HRESULT get_moniker_for_progid_display_name(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, LPMONIKER *ppmk)
static HRESULT WINAPI MonikerMarshal_GetMarshalSizeMax(LPMARSHAL iface, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, DWORD *pSize)
void *__RPC_USER MIDL_user_allocate(SIZE_T size)
static HRESULT WINAPI RunningObjectTableImpl_EnumRunning(IRunningObjectTable *iface, IEnumMoniker **ppenumMoniker)
static ULONG WINAPI MonikerMarshal_AddRef(IMarshal *iface)
HRESULT MonikerMarshal_Create(IMoniker *inner, IUnknown **outer)
static ULONG WINAPI MonikerMarshalInner_Release(IUnknown *iface)
static HRESULT WINAPI RunningObjectTableImpl_Revoke(IRunningObjectTable *iface, DWORD dwRegister)
static HRESULT EnumMonikerImpl_CreateEnumROTMoniker(InterfaceList *moniker_list, ULONG pos, IEnumMoniker **ppenumMoniker)
static HRESULT create_stream_on_mip_ro(const InterfaceData *mip, IStream **stream)
static MonikerMarshal * impl_from_IUnknown(IUnknown *iface)
static MonikerMarshal * impl_from_IMarshal(IMarshal *iface)
static LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
static const IUnknownVtbl VT_MonikerMarshalInner
static RunningObjectTableImpl * impl_from_IRunningObjectTable(IRunningObjectTable *iface)
static HRESULT WINAPI MonikerMarshal_GetUnmarshalClass(LPMARSHAL iface, REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *pCid)
static HRESULT WINAPI MonikerMarshal_QueryInterface(IMarshal *iface, REFIID riid, LPVOID *ppv)
static ULONG WINAPI MonikerMarshalInner_AddRef(IUnknown *iface)
static HRESULT RunningObjectTableImpl_Destroy(void)
static ULONG WINAPI MonikerMarshal_Release(IMarshal *iface)
static HRESULT WINAPI EnumMonikerImpl_Next(IEnumMoniker *iface, ULONG celt, IMoniker **rgelt, ULONG *pceltFetched)
static ULONG WINAPI RunningObjectTableImpl_Release(IRunningObjectTable *iface)
static HRESULT WINAPI RunningObjectTableImpl_NoteChangeTime(IRunningObjectTable *iface, DWORD dwRegister, FILETIME *pfiletime)
static ULONG WINAPI EnumMonikerImpl_AddRef(IEnumMoniker *iface)
static HRESULT WINAPI RunningObjectTableImpl_Register(IRunningObjectTable *iface, DWORD grfFlags, IUnknown *punkObject, IMoniker *pmkObjectName, DWORD *pdwRegister)
static BOOL start_rpcss(void)
static HRESULT WINAPI EnumMonikerImpl_QueryInterface(IEnumMoniker *iface, REFIID riid, void **ppvObject)
static ULONG WINAPI RunningObjectTableImpl_AddRef(IRunningObjectTable *iface)
static HRESULT WINAPI MonikerMarshal_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm)
static HRESULT WINAPI RunningObjectTableImpl_GetTimeOfLastChange(IRunningObjectTable *iface, IMoniker *pmkObjectName, FILETIME *pfiletime)
static HRESULT WINAPI RunningObjectTableImpl_IsRunning(IRunningObjectTable *iface, IMoniker *pmkObjectName)
void __RPC_USER MIDL_user_free(void *p)
static HRESULT WINAPI MonikerMarshal_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void **ppv)
static const IRunningObjectTableVtbl VT_RunningObjectTableImpl
static const IMarshalVtbl VT_MonikerMarshal
static const IEnumMonikerVtbl VT_EnumMonikerImpl
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
HRESULT WINAPI ReadClassStg(IStorage *pstg, CLSID *pclsid)
HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn)
HRESULT FileMoniker_CreateFromDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, IMoniker **ppmk)
int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR **stringTable)
GLuint GLsizei GLsizei * length
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
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
BOOL WINAPI IsValidInterface(LPUNKNOWN punk)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
#define InterlockedCompareExchangePointer
HRESULT __cdecl IrotRevoke(IrotHandle h, IrotCookie cookie, IrotContextHandle *ctxt_handle, PInterfaceData *obj, PInterfaceData *mk)
HRESULT __cdecl IrotEnumRunning(IrotHandle h, PInterfaceList *list)
HRESULT __cdecl IrotGetObject(IrotHandle h, const MonikerComparisonData *moniker_data, PInterfaceData *obj, IrotCookie *cookie)
HRESULT __cdecl IrotRegister(IrotHandle h, const MonikerComparisonData *data, const InterfaceData *obj, const InterfaceData *mk, const FILETIME *time, DWORD grfFlags, IrotCookie *cookie, IrotContextHandle *ctxt_handle)
HRESULT __cdecl IrotIsRunning(IrotHandle h, const MonikerComparisonData *data)
HRESULT __cdecl IrotGetTimeOfLastChange(IrotHandle h, const MonikerComparisonData *moniker_data, FILETIME *time)
HRESULT __cdecl IrotNoteChangeTime(IrotHandle h, IrotCookie cookie, const FILETIME *last_modified_time)
#define memcpy(s1, s2, n)
static const WCHAR dotW[]
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
#define STGM_SHARE_DENY_WRITE
interface IMoniker * LPMONIKER
interface IBindCtx * LPBC
interface IMarshal * LPMARSHAL
interface IRunningObjectTable * LPRUNNINGOBJECTTABLE
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
const GUID IID_IParseDisplayName
const GUID IID_IEnumMoniker
#define IsEqualIID(riid1, riid2)
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
RPCRTAPI int RPC_ENTRY I_RpcExceptionFilter(ULONG)
unsigned short * RPC_WSTR
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI StartServiceW(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_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)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
IEnumMoniker IEnumMoniker_iface
InterfaceList * moniker_list
IRunningObjectTable IRunningObjectTable_iface
PEXCEPTION_RECORD ExceptionRecord
IrotContextHandle ctxt_handle
MonikerComparisonData * moniker_data
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
_In_ PUSBD_INTERFACE_LIST_ENTRY InterfaceList
DWORD WINAPI GetLastError(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define ERROR_SERVICE_ALREADY_RUNNING
#define HRESULT_FROM_WIN32(x)
#define RPC_S_SERVER_UNAVAILABLE
#define MK_E_INVALIDEXTENSION
#define HKEY_CLASSES_ROOT
#define SERVICE_QUERY_STATUS
#define SERVICE_START_PENDING