LONG m_lRef;
bool bDone;
HANDLE triggerevent;
- HANDLE triggererror;
+ HANDLE triggererror;
public:
char *path;
WatchSink(HANDLE event, HANDLE errorevent, const char *path) {
m_lRef = 1;
triggerevent = event;
- triggererror = errorevent;
+ triggererror = errorevent;
this->path = NULL;
if (path) {
this->path=(char *)XsAlloc(strlen(path)+1);
/* [in] */ IWbemClassObject __RPC_FAR *pObjParam
)
{
- if (FAILED(hResult)) {
- XsLog("WMI Asyc watch failed %p\n", this);
- SetEvent(this->triggererror);
- }
+ if (FAILED(hResult)) {
+ XsLog("WMI Asyc watch failed %p\n", this);
+ SetEvent(this->triggererror);
+ }
return WBEM_S_NO_ERROR;
}
NULL,
NULL);
- return str;
+ return str;
}
static string bstr2string(const BSTR& bstr)
{
- wstring wstr(bstr);
+ wstring wstr(bstr);
- return wstring2string(wstr);
+ return wstring2string(wstr);
}
IWbemClassObject *getClass(WMIAccessor **wmi, BSTR path) {
return NULL;
if ((*wmi)->mpXSSvc == NULL)
- return NULL;
+ return NULL;
IWbemClassObject *returnedObject;
HRESULT hres = (*wmi)->mpXSSvc->GetObject(path,WBEM_FLAG_RETURN_WBEM_COMPLETE,
NULL,
&returnedEnum);
if (FAILED(hres)) {
- OutputDebugString("GetEnum failed\n");
+ OutputDebugString("GetEnum failed\n");
returnedObject =NULL;
- return returnedObject;
+ return returnedObject;
}
ULONG objects;
&pEnumerator);
if (FAILED(hres))
{
- DBGPRINT(("ExecQuery failed\n"));
- pEnumerator = NULL;
+ DBGPRINT(("ExecQuery failed\n"));
+ pEnumerator = NULL;
}
- return pEnumerator;
+ return pEnumerator;
}
static IEnumWbemClassObject* runQuery(WMIAccessor *wmi, BSTR query)
{
&pEnumerator);
if (FAILED(hres))
{
- DBGPRINT(("ExecQuery failed\n"));
- pEnumerator = NULL;
+ DBGPRINT(("ExecQuery failed\n"));
+ pEnumerator = NULL;
}
- return pEnumerator;
+ return pEnumerator;
}
LONG wmicount = 0;
static BOOLEAN com_initialized = false;
static IWbemLocator *locator = 0;
BOOL InitCom(void) {
- HRESULT hres;
- XsLog("Init COM");
- hres = CoInitializeEx(0, COINIT_MULTITHREADED);
- if (FAILED(hres)) {
- goto err_out;
- }
- com_initialized = TRUE;
- //wmi->owning_thread = GetCurrentThread();
- //XsLog("Wmi connect thread %p", GetCurrentThread());
- // Initialize COM security. Most of this is irrelevant to us.
- XsLog("Init security");
- hres = CoInitializeSecurity(
- NULL, /* Security descriptor. Only relevant to servers */
- -1, /* Nr. of auth services. Only relevant to servers */
- NULL, /* List of auth services. Only relevant to servers */
- NULL, /* Reserved */
- RPC_C_AUTHN_LEVEL_DEFAULT, /* Default authentication. The
- details don't really matter when
- you're localhost. */
- RPC_C_IMP_LEVEL_IMPERSONATE, /* WMI needs to be able to
- impersonate us. */
- NULL, /* Authentication info */
- EOAC_NONE, /* Additional capabilities */
- NULL /* Reserved */
- );
- if (FAILED(hres)) {
- goto err_out;
- }
- OutputDebugString("CreateInstance\n");
- hres = CoCreateInstance(
- CLSID_WbemLocator,
- 0,
- CLSCTX_INPROC_SERVER,
- IID_IWbemLocator,
- (LPVOID *) &locator);
- OutputDebugString("Check hres\n");
- if (FAILED(hres)) {
- goto err_out;
- }
- if (locator == NULL) {
- OutputDebugString("Null locator");
- goto err_out;
- }
- return true;
+ HRESULT hres;
+ XsLog("Init COM");
+ hres = CoInitializeEx(0, COINIT_MULTITHREADED);
+ if (FAILED(hres)) {
+ goto err_out;
+ }
+ com_initialized = TRUE;
+ //wmi->owning_thread = GetCurrentThread();
+ //XsLog("Wmi connect thread %p", GetCurrentThread());
+ // Initialize COM security. Most of this is irrelevant to us.
+ XsLog("Init security");
+ hres = CoInitializeSecurity(
+ NULL, /* Security descriptor. Only relevant to servers */
+ -1, /* Nr. of auth services. Only relevant to servers */
+ NULL, /* List of auth services. Only relevant to servers */
+ NULL, /* Reserved */
+ RPC_C_AUTHN_LEVEL_DEFAULT, /* Default authentication. The
+ details don't really matter when
+ you're localhost. */
+ RPC_C_IMP_LEVEL_IMPERSONATE, /* WMI needs to be able to
+ impersonate us. */
+ NULL, /* Authentication info */
+ EOAC_NONE, /* Additional capabilities */
+ NULL /* Reserved */
+ );
+ if (FAILED(hres)) {
+ goto err_out;
+ }
+ OutputDebugString("CreateInstance\n");
+ hres = CoCreateInstance(
+ CLSID_WbemLocator,
+ 0,
+ CLSCTX_INPROC_SERVER,
+ IID_IWbemLocator,
+ (LPVOID *) &locator);
+ OutputDebugString("Check hres\n");
+ if (FAILED(hres)) {
+ goto err_out;
+ }
+ if (locator == NULL) {
+ OutputDebugString("Null locator");
+ goto err_out;
+ }
+ return true;
err_out:
- return false;
+ return false;
}
BOOL ConnectToWMI(void)
{
- InitCom();
- HRESULT hres;
- OutputDebugString("Connect to WMI");
- wmicount++;
-
- wmi = (struct WMIAccessor *)XsAlloc(sizeof(*wmi));
- if (wmi == NULL) {
- return false;
- }
- memset(wmi, 0, sizeof(*wmi));
-
-
- OutputDebugString("Connect Server\n");
- try {
- hres = locator->ConnectServer(
- L"root\\CIMV2", // WMI namespace
- NULL, // User name
- NULL, // User password
- NULL, // Locale
- 0, // Security flags
- NULL, // Authority
- NULL, // Context object
- &(wmi->mpSvc) // IWbemServices proxy
- );
- }
- catch(...) {
- OutputDebugString("Exception connecting to server\n");
- goto err_out;
- }
-
- OutputDebugString("Check result\n");
- if (FAILED(hres)) {
- goto err_out;
- }
- /* WMI needs to impersonate us, because it normally runs as an
- unprivileged user and needs our authority in order to access
- device files and so forth. Turn impersonation on. */
- OutputDebugString("Proxy blanket\n");
- hres = CoSetProxyBlanket(
- wmi->mpSvc, // the proxy to set
- RPC_C_AUTHN_WINNT, /* LAN manager authentication,
- although it doesn't really
- matter on localhost. */
- RPC_C_AUTHZ_NONE, // LANMAN can't do much authorization.
- NULL, // Server principal name
- RPC_C_AUTHN_LEVEL_CALL, // Do authentication on every call
- RPC_C_IMP_LEVEL_IMPERSONATE, // Allow full impersonation.
- NULL, // Use current client identity
- EOAC_NONE // No extended proxy capabilities
- );
- if (FAILED(hres)) {
- goto err_out;
- }
- OutputDebugString("WMI Server\n");
- hres = locator->ConnectServer(
- L"root\\WMI", // WMI namespace
- NULL, // User name
- NULL, // User password
- NULL, // Locale
- 0, // Security flags
- NULL, // Authority
- NULL, // Context object
- &wmi->mpXSSvc // IWbemServices proxy
- );
-
- if (FAILED(hres)) {
- goto err_out;
- }
- OutputDebugString("Impersonation\n");
- /* WMI needs to impersonate us, because it normally runs as an
- unprivileged user and needs our authority in order to access
- device files and so forth. Turn impersonation on. */
- hres = CoSetProxyBlanket(
- wmi->mpXSSvc, // the proxy to set
- RPC_C_AUTHN_WINNT, /* LAN manager authentication,
- although it doesn't really
- matter on localhost. */
- RPC_C_AUTHZ_NONE, // LANMAN can't do much authorization.
- NULL, // Server principal name
- RPC_C_AUTHN_LEVEL_CALL, // Do authentication on every call
- RPC_C_IMP_LEVEL_IMPERSONATE, // Allow full impersonation.
- NULL, // Use current client identity
- EOAC_NONE // No extended proxy capabilities
- );
- if (FAILED(hres)) {
- goto err_out;
- }
-
-
- OutputDebugString("Wmi connected\n");
+ InitCom();
+ HRESULT hres;
+ OutputDebugString("Connect to WMI");
+ wmicount++;
+
+ wmi = (struct WMIAccessor *)XsAlloc(sizeof(*wmi));
+ if (wmi == NULL) {
+ return false;
+ }
+ memset(wmi, 0, sizeof(*wmi));
+
+
+ OutputDebugString("Connect Server\n");
+ try {
+ hres = locator->ConnectServer(
+ L"root\\CIMV2", // WMI namespace
+ NULL, // User name
+ NULL, // User password
+ NULL, // Locale
+ 0, // Security flags
+ NULL, // Authority
+ NULL, // Context object
+ &(wmi->mpSvc) // IWbemServices proxy
+ );
+ }
+ catch(...) {
+ OutputDebugString("Exception connecting to server\n");
+ goto err_out;
+ }
+
+ OutputDebugString("Check result\n");
+ if (FAILED(hres)) {
+ goto err_out;
+ }
+ /* WMI needs to impersonate us, because it normally runs as an
+ unprivileged user and needs our authority in order to access
+ device files and so forth. Turn impersonation on. */
+ OutputDebugString("Proxy blanket\n");
+ hres = CoSetProxyBlanket(
+ wmi->mpSvc, // the proxy to set
+ RPC_C_AUTHN_WINNT, /* LAN manager authentication,
+ although it doesn't really
+ matter on localhost. */
+ RPC_C_AUTHZ_NONE, // LANMAN can't do much authorization.
+ NULL, // Server principal name
+ RPC_C_AUTHN_LEVEL_CALL, // Do authentication on every call
+ RPC_C_IMP_LEVEL_IMPERSONATE, // Allow full impersonation.
+ NULL, // Use current client identity
+ EOAC_NONE // No extended proxy capabilities
+ );
+ if (FAILED(hres)) {
+ goto err_out;
+ }
+ OutputDebugString("WMI Server\n");
+ hres = locator->ConnectServer(
+ L"root\\WMI", // WMI namespace
+ NULL, // User name
+ NULL, // User password
+ NULL, // Locale
+ 0, // Security flags
+ NULL, // Authority
+ NULL, // Context object
+ &wmi->mpXSSvc // IWbemServices proxy
+ );
+
+ if (FAILED(hres)) {
+ goto err_out;
+ }
+ OutputDebugString("Impersonation\n");
+ /* WMI needs to impersonate us, because it normally runs as an
+ unprivileged user and needs our authority in order to access
+ device files and so forth. Turn impersonation on. */
+ hres = CoSetProxyBlanket(
+ wmi->mpXSSvc, // the proxy to set
+ RPC_C_AUTHN_WINNT, /* LAN manager authentication,
+ although it doesn't really
+ matter on localhost. */
+ RPC_C_AUTHZ_NONE, // LANMAN can't do much authorization.
+ NULL, // Server principal name
+ RPC_C_AUTHN_LEVEL_CALL, // Do authentication on every call
+ RPC_C_IMP_LEVEL_IMPERSONATE, // Allow full impersonation.
+ NULL, // Use current client identity
+ EOAC_NONE // No extended proxy capabilities
+ );
+ if (FAILED(hres)) {
+ goto err_out;
+ }
+
+
+ OutputDebugString("Wmi connected\n");
/* All done. */
return true;
err_out:
- OutputDebugString("WMI connection failed\n");
+ OutputDebugString("WMI connection failed\n");
ReleaseWMIAccessor(&wmi);
return false;
}
void ReleaseCom(void) {
- if (com_initialized) {
- OutputDebugString("Release locator\n");
- locator->Release();
- //XsLog("Wmi disconnect thread %p", GetCurrentThread());
+ if (com_initialized) {
+ OutputDebugString("Release locator\n");
+ locator->Release();
+ //XsLog("Wmi disconnect thread %p", GetCurrentThread());
//ASSERT((*wmi)->owning_thread == GetCurrentThread());
- com_initialized = 0;
- OutputDebugString("Uninitialize com\n");
+ com_initialized = 0;
+ OutputDebugString("Uninitialize com\n");
CoUninitialize();
-
+
}
}
allocated them. */
void ReleaseWMIAccessor(struct WMIAccessor **wmi)
{
- OutputDebugString("Should I release wmi?\n");
+ OutputDebugString("Should I release wmi?\n");
if (*wmi == NULL)
return;
- OutputDebugString("Get rid of WMI servers\n");
+ OutputDebugString("Get rid of WMI servers\n");
if ((*wmi)->mpXSSvc != NULL)
(*wmi)->mpXSSvc->Release();
if ((*wmi)->mpSvc != NULL)
/* Poison wmi to make use-after-free()s a bit more obvious. */
memset((*wmi), 0xab, sizeof(**wmi));
XsFree(*wmi);
- *wmi = NULL;
- ReleaseCom();
- OutputDebugString("Released WMI\n");
+ *wmi = NULL;
+ ReleaseCom();
+ OutputDebugString("Released WMI\n");
}
/* The fact that something is documented as being a uint64_t field
IWbemClassObject *getBase(WMIAccessor** wmi)
{
IWbemClassObject* base = getObject(wmi, L"CitrixXenStoreBase");
- if (base == NULL) {
- *wmi = NULL;
- return NULL;
- }
- return base;
+ if (base == NULL) {
+ *wmi = NULL;
+ return NULL;
+ }
+ return base;
}
IWbemClassObject *getBaseClass(WMIAccessor** wmi)
{
IWbemClassObject* baseclass = getClass(wmi, L"CitrixXenStoreBase");
- if (baseclass == NULL) {
- *wmi = NULL;
- return NULL;
- }
- return baseclass;
+ if (baseclass == NULL) {
+ *wmi = NULL;
+ return NULL;
+ }
+ return baseclass;
}
ULONGLONG get64BitUnsigned(VARIANT *var) {
FILETIME WmiGetXenTime(WMIAccessor **wmi) {
FILETIME out;
- IWbemClassObject *base = getBase(wmi);
+ IWbemClassObject *base = getBase(wmi);
if (base == NULL) {
DBGPRINT(("Unable to find base WMI session\n"));
goto getbasefailed;
VARIANT timevar;
BSTR timename = mkBstr("XenTime", 7);
- if (timename == NULL)
- goto buildtimenamefailed;
-
+ if (timename == NULL)
+ goto buildtimenamefailed;
+
if (FAILED(base->Get(timename, 0, &timevar, NULL, NULL)))
- goto gettimefailed;
+ goto gettimefailed;
ULONGLONG time =get64BitUnsigned(&timevar);;
gettimefailed:
buildtimenamefailed:
getbasefailed:
- out.dwLowDateTime = 0;
+ out.dwLowDateTime = 0;
out.dwHighDateTime = 0;
return out ;
}
HRESULT hres;
BSTR query = formatBstr("SELECT * FROM CitrixXenStoreSession WHERE Id=\"Citrix Xen Win32 Service : %s\"", sessionname);
- if (query == NULL)
- goto formatsessionbstrfailed;
+ if (query == NULL)
+ goto formatsessionbstrfailed;
IEnumWbemClassObject * sessions = runXSQuery(wmi, query);
SysFreeString(query);
IWbemClassObject *returnedObject;
ULONG count;
hres = sessions->Next(WBEM_INFINITE, 1, &returnedObject, &count);
- sessions->Release();
+ sessions->Release();
if (count>0) {
if (sessionname !=NULL ) {
if (!WmiSessionEnd(wmi, returnedObject)) {
- return NULL;
- }
+ return NULL;
+ }
}
else {
return returnedObject;
IWbemClassObject *baseclass = getBaseClass(wmi);
- if (baseclass == NULL)
- goto getbaseclassfailed;
+ if (baseclass == NULL)
+ goto getbaseclassfailed;
IWbemClassObject *inMethod;
IWbemClassObject *inMethodInst;
IWbemClassObject *outMethodInst;
if (FAILED(baseclass->GetMethod(L"AddSession",0,&inMethod, NULL)))
- goto getmethodaddsessionfailed;
+ goto getmethodaddsessionfailed;
if (FAILED(inMethod->SpawnInstance(0, &inMethodInst)))
- goto inmethodspawnfailed;
+ goto inmethodspawnfailed;
VARIANT var;
var.vt = VT_BSTR;
var.bstrVal=formatBstr("Citrix Xen Win32 Service : %s", sessionname);
- if (var.bstrVal == NULL)
- goto formatnamebstrfailed;
+ if (var.bstrVal == NULL)
+ goto formatnamebstrfailed;
if (FAILED(inMethodInst->Put(L"Id", 0, &var, 0)))
- goto methodputfailed;
+ goto methodputfailed;
if (FAILED(methodExec(wmi, base, L"AddSession", inMethodInst, &outMethodInst)))
- goto methodexecaddsessionfailed;
+ goto methodexecaddsessionfailed;
if (FAILED(outMethodInst->Get(L"SessionId", 0, &var, NULL, NULL)))
- goto outmethodgetfailed;
+ goto outmethodgetfailed;
ULONG query_len;
query_len = strlen("SELECT * FROM CitrixXenStoreSession WHERE SessionId=")+10;
query = SysAllocStringLen(NULL, query_len);
- if (query == NULL)
- goto allocqueryfailed;
+ if (query == NULL)
+ goto allocqueryfailed;
swprintf_s(query,query_len, L"SELECT * FROM CitrixXenStoreSession WHERE SessionId=%d", var.uintVal);
sessions = runXSQuery(wmi, query );
- SysFreeString(query);
+ SysFreeString(query);
if (sessions) {
IWbemClassObject *returnedObject;
ULONG count;
hres = sessions->Next(WBEM_INFINITE, 1, &returnedObject, &count);
- sessions->Release();
+ sessions->Release();
if (count>0) {
return returnedObject;
}
}
-
- outMethodInst->Release();
- VariantClear(&var);
- inMethodInst->Release();
- inMethod->Release();
+
+ outMethodInst->Release();
+ VariantClear(&var);
+ inMethodInst->Release();
+ inMethod->Release();
base->Release();
- baseclass->Release();
+ baseclass->Release();
return NULL;
allocqueryfailed:
outmethodgetfailed:
- outMethodInst->Release();
+ outMethodInst->Release();
methodexecaddsessionfailed:
methodputfailed:
- VariantClear(&var);
+ VariantClear(&var);
formatnamebstrfailed:
- inMethodInst->Release();
+ inMethodInst->Release();
inmethodspawnfailed:
- inMethod->Release();
+ inMethod->Release();
getmethodaddsessionfailed:
- baseclass->Release();
+ baseclass->Release();
getbaseclassfailed:
- base->Release();
+ base->Release();
getbasefailed:
formatsessionbstrfailed:
- return NULL;
+ return NULL;
}
IWbemClassObject* sessionMethodStart(WMIAccessor**wmi,
IWbemClassObject *inMethod;
IWbemClassObject *inMethodInst = NULL;
IWbemClassObject *sessionClass;
- HRESULT hr;
+ HRESULT hr;
- ASSERT(wmi != NULL);
+ ASSERT(wmi != NULL);
sessionClass = getClass(wmi, L"CitrixXenStoreSession");
- if (sessionClass == NULL)
- goto getclassfailed;
+ if (sessionClass == NULL)
+ goto getclassfailed;
hr = sessionClass->GetMethod(methodname,0,&inMethod, NULL);
- if (FAILED(hr))
- goto getmethodfailed;
+ if (FAILED(hr))
+ goto getmethodfailed;
hr = inMethod->SpawnInstance(0, &inMethodInst);
- if (FAILED(hr))
- goto spawninstancefailed;
+ if (FAILED(hr))
+ goto spawninstancefailed;
- inMethod->Release();
+ inMethod->Release();
- sessionClass->Release();
- return inMethodInst;
+ sessionClass->Release();
+ return inMethodInst;
spawninstancefailed:
- inMethod->Release();
-
+ inMethod->Release();
+
getmethodfailed:
- sessionClass->Release();
+ sessionClass->Release();
getclassfailed:
return NULL;
char * bstrToChar(BSTR bst, size_t *len) {
*len = wcslen(bst);
char *space = (char *)XsAlloc(*len+1);
- if (space)
+ if (space)
wcstombs_s(len, space, *len+1, bst, _TRUNCATE);
return space;
}
char* message = formatCharStrInt(fmt,args);
- OutputDebugString(message);
- if (((*wmi)==NULL) || ((*sessionhandle)==NULL) ) {
- goto nowmi;
- }
+ OutputDebugString(message);
+ if (((*wmi)==NULL) || ((*sessionhandle)==NULL) ) {
+ goto nowmi;
+ }
VARIANT vmessage;
if (setVariantString(&vmessage, message))
goto setvmessage;
goto sessionstart;
if (FAILED(inMethodInst->Put(L"Message",0,&vmessage,0)))
- goto methodputfailed;
+ goto methodputfailed;
if (FAILED(methodExec(wmi,*session, L"Log", inMethodInst, NULL)))
- goto methodexecfailed;
+ goto methodexecfailed;
methodexecfailed:
methodputfailed:
- inMethodInst->Release();
+ inMethodInst->Release();
sessionstart:
VariantClear(&vmessage);
IWbemClassObject *outMethodInst;
IWbemClassObject *inMethodInst = sessionMethodStart( wmi, L"GetValue");
- if (inMethodInst == NULL)
- goto sessionmethodstartfailed;
+ if (inMethodInst == NULL)
+ goto sessionmethodstartfailed;
- if (FAILED(inMethodInst->Put(L"PathName",0,&vpath,0)))
- goto methodexecfailed;
+ if (FAILED(inMethodInst->Put(L"PathName",0,&vpath,0)))
+ goto methodexecfailed;
methodExec(wmi,*session, L"GetValue", inMethodInst, &outMethodInst);
if (outMethodInst==NULL)
VariantInit(&outval);
if (FAILED(outMethodInst->Get(L"value", 0, &outval, NULL, NULL)))
- goto methodgetfailed;
+ goto methodgetfailed;
char *space = NULL;
space = bstrToChar(outval.bstrVal, len);
}
- outMethodInst->Release();
- inMethodInst->Release();
- VariantClear(&vpath);
+ outMethodInst->Release();
+ inMethodInst->Release();
+ VariantClear(&vpath);
VariantClear(&outval);
return space;
methodgetfailed:
- outMethodInst->Release();
+ outMethodInst->Release();
methodexecfailed:
sessionExec:
- inMethodInst->Release();
+ inMethodInst->Release();
sessionmethodstartfailed:
- VariantClear(&vpath);
+ VariantClear(&vpath);
setvpath:
return NULL;
inMethodInst->Put(L"value",0,&vvalue,0);
if (FAILED(methodExec(wmi,*session, L"SetValue", inMethodInst, &outMethodInst)))
- goto methodexecfailed;
+ goto methodexecfailed;
if (outMethodInst!=NULL)
outMethodInst->Release();
- inMethodInst->Release();
+ inMethodInst->Release();
SysFreeString(vvalue.bstrVal);
SysFreeString(vpath.bstrVal);
methodexecfailed:
XsLog("WmiSessionSetEntry:MethodExec Failed");
- inMethodInst->Release();
+ inMethodInst->Release();
sessionstart:
XsLog("WmiSessionSetEntry:SessionStart Failed");
goto sessionstart;
if (FAILED(inMethodInst->Put(L"PathName",0,&vpath,0)))
- goto methodputfailed;
+ goto methodputfailed;
IWbemClassObject* outMethodInst;
if (FAILED(methodExec(wmi,*session, L"RemoveValue", inMethodInst, &outMethodInst)))
- goto methodexecfailed;
+ goto methodexecfailed;
if (outMethodInst==NULL)
goto sessionExec;
err=0;
methodexecfailed:
methodputfailed:
- inMethodInst->Release();
+ inMethodInst->Release();
sessionstart:
VariantClear(&vpath);
BOOL WmiSessionUnwatch(WMIAccessor** wmi, void **sessionhandle,
void *watchhandle) {
IWbemClassObject **session = (IWbemClassObject **)sessionhandle;
- XsLog("Unwatch %p",watchhandle);
+ XsLog("Unwatch %p",watchhandle);
WatchSink * sink = (WatchSink *)watchhandle;
VARIANT vpath;
inMethodInst->Put(L"PathName",0,&vpath,0);
if FAILED(methodExec(wmi,*session, L"RemoveWatch", inMethodInst, &outMethodInst))
- goto methodexecfailed;
+ goto methodexecfailed;
if (outMethodInst==NULL)
goto sessionexecfailed;
sessionstart:
setvpath:
sink->Release();
- return true;
+ return true;
}
BOOL WmiSessionStart(WMIAccessor** wmi, void **sessionhandle, const char* sessionname)
{
IWbemClassObject **session = (IWbemClassObject **)sessionhandle;
if ((*session = openSession(wmi, sessionname)) == NULL) {
- return false;
- }
- return true;
+ return false;
+ }
+ return true;
}
BOOL WmiSessionEnd(WMIAccessor** wmi, void *sessionhandle)
{
- HRESULT hr;
- ASSERT(*wmi != NULL);
+ HRESULT hr;
+ ASSERT(*wmi != NULL);
IWbemClassObject *session = (IWbemClassObject *)sessionhandle;
if (session==NULL) {
return false;
}
hr = methodExec(wmi, session, L"EndSession", NULL,NULL);
- if FAILED(hr)
- goto execmethodfailed;
+ if FAILED(hr)
+ goto execmethodfailed;
session->Release();
- return true;
+ return true;
execmethodfailed:
- return false;
+ return false;
}
IWbemClassObject **session = (IWbemClassObject **)sessionhandle;
- ASSERT((*wmi) != NULL);
- ASSERT((*sessionhandle) != NULL);
+ ASSERT((*wmi) != NULL);
+ ASSERT((*sessionhandle) != NULL);
WatchSink * sink = new WatchSink(event, errorevent, path);
BSTR query=formatBstr("SELECT * from CitrixXenStoreWatchEvent WHERE EventId=\"%s\"", path);
- if (query == NULL) {
- goto formatstringfailed;
- }
+ if (query == NULL) {
+ goto formatstringfailed;
+ }
- hr = (*wmi)->mpXSSvc->ExecNotificationQueryAsync(L"WQL", query,0,NULL, sink);
+ hr = (*wmi)->mpXSSvc->ExecNotificationQueryAsync(L"WQL", query,0,NULL, sink);
if (FAILED(hr)){
- *wmi = NULL;
- goto wmifailed;
- }
+ *wmi = NULL;
+ goto wmifailed;
+ }
VARIANT vpath;
if (setVariantString(&vpath, path)){
goto sessionstart;
hr = inMethodInst->Put(L"PathName",0,&vpath,0);
- if (FAILED(hr))
- goto methodputfailed;
+ if (FAILED(hr))
+ goto methodputfailed;
hr = methodExec(wmi,*session, L"SetWatch", inMethodInst, NULL);
- if (FAILED(hr))
- goto methodexecfailed;
+ if (FAILED(hr))
+ goto methodexecfailed;
- VariantClear(&vpath);
+ VariantClear(&vpath);
- SysFreeString(query);
+ SysFreeString(query);
- return sink;
+ return sink;
methodexecfailed:
- OutputDebugString(__FUNCTION__ " : methodexecfailed\n");
+ OutputDebugString(__FUNCTION__ " : methodexecfailed\n");
methodputfailed:
- OutputDebugString(__FUNCTION__ " : methodputfailed\n");
- inMethodInst->Release();
+ OutputDebugString(__FUNCTION__ " : methodputfailed\n");
+ inMethodInst->Release();
sessionstart:
- OutputDebugString(__FUNCTION__ " : sessionstart\n");
- VariantClear(&vpath);
+ OutputDebugString(__FUNCTION__ " : sessionstart\n");
+ VariantClear(&vpath);
setvpath:
- OutputDebugString(__FUNCTION__ " : setvpath\n");
+ OutputDebugString(__FUNCTION__ " : setvpath\n");
wmifailed:
- SysFreeString(query);
+ SysFreeString(query);
formatstringfailed:
- OutputDebugString(__FUNCTION__ " : formatstringfailed\n");
- delete sink;
+ OutputDebugString(__FUNCTION__ " : formatstringfailed\n");
+ delete sink;
return NULL;
}
void *WmiUnsuspendedEventWatch(WMIAccessor **wmi, HANDLE event, HANDLE errorevent)
{
- HRESULT hr;
+ HRESULT hr;
- ASSERT(*wmi != NULL);
+ ASSERT(*wmi != NULL);
WatchSink * sink = new WatchSink(event, errorevent, NULL);
BSTR query=formatBstr("SELECT * from CitrixXenStoreUnsuspendedEvent");
- if (query==NULL) {
- goto formatstringfailed;
- }
+ if (query==NULL) {
+ goto formatstringfailed;
+ }
hr = (*wmi)->mpXSSvc->ExecNotificationQueryAsync(L"WQL", query,0,NULL, sink);
- if FAILED(hr)
- goto asyncqueryfailed;
+ if FAILED(hr)
+ goto asyncqueryfailed;
- SysFreeString(query);
+ SysFreeString(query);
return sink;
asyncqueryfailed:
- SysFreeString(query);
+ SysFreeString(query);
formatstringfailed:
- delete sink;
- return NULL;
+ delete sink;
+ return NULL;
}
void PrintError(const char *func, DWORD err)
{
- LPVOID lpMsgBuf;
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL);
- OutputDebugString((LPTSTR)lpMsgBuf);
+ LPVOID lpMsgBuf;
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,
+ err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL);
+ OutputDebugString((LPTSTR)lpMsgBuf);
XenstorePrintf("control/error", "%s failed: %s (%x)", func, lpMsgBuf, err);
- LocalFree(lpMsgBuf);
+ LocalFree(lpMsgBuf);
}
void PrintError(const char *func)
{
- PrintError(func, GetLastError());
+ PrintError(func, GetLastError());
}
void PrintUsage()
{
- printf("Usage: xenservice [-u]\n");
+ printf("Usage: xenservice [-u]\n");
- printf("\t -u: uninstall service\n");
+ printf("\t -u: uninstall service\n");
}
{
struct watch_event *we;
DWORD err;
- XsLog("Establish watch %s",path);
+ XsLog("Establish watch %s",path);
we = (struct watch_event *)malloc(sizeof(*we));
if (!we) {
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
if (we->event != INVALID_HANDLE_VALUE)
we->watch = XenstoreWatch(path, we->event, errorevent);
if (we->watch == NULL) {
- OutputDebugString("Watch is null\n");
+ OutputDebugString("Watch is null\n");
err = GetLastError();
ReleaseWatch(we);
SetLastError(err);
if (wfs->features[n].name == NULL)
goto failname;
wfs->nr_features++;
- return true;
+ return true;
failname:
PrintError("Failed to allocate string");
}
static void RemoveFeatures(struct watch_feature_set *wfs) {
- unsigned x;
+ unsigned x;
for (x = 0; x < wfs->nr_features; x++) {
- ReleaseWatch(wfs->features[x].watch);
- wfs->features[x].watch = NULL;
+ ReleaseWatch(wfs->features[x].watch);
+ wfs->features[x].watch = NULL;
FreeString(wfs->features[x].name);
- XenstoreRemove(wfs->features[x].feature_flag);
- }
- wfs->nr_features = 0;
+ XenstoreRemove(wfs->features[x].feature_flag);
+ }
+ wfs->nr_features = 0;
}
static BOOL
XsLog("Failed to advertise %s",wfs->features[x].name);
}
}
- return true;
+ return true;
}
void ServiceUninstall()
{
- SC_HANDLE hSvc;
- SC_HANDLE hMgr;
-
- hMgr = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-
- if ( hMgr )
- {
- hSvc = OpenService(hMgr, SVC_NAME, SERVICE_ALL_ACCESS);
-
- if (hSvc)
- {
- // try to stop the service
- if ( ControlService( hSvc, SERVICE_CONTROL_STOP, &ServiceStatus ) )
- {
- printf("Stopping %s.", SVC_DISPLAYNAME);
- Sleep( 1000 );
-
- while ( QueryServiceStatus( hSvc, &ServiceStatus ) )
- {
- if ( ServiceStatus.dwCurrentState == SERVICE_STOP_PENDING )
- {
- printf(".");
- Sleep( 1000 );
- }
- else
- break;
- }
-
- if ( ServiceStatus.dwCurrentState == SERVICE_STOPPED )
- printf("\n%s stopped.\n", SVC_DISPLAYNAME );
- else
- printf("\n%s failed to stop.\n", SVC_DISPLAYNAME );
+ SC_HANDLE hSvc;
+ SC_HANDLE hMgr;
+
+ hMgr = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
+
+ if ( hMgr )
+ {
+ hSvc = OpenService(hMgr, SVC_NAME, SERVICE_ALL_ACCESS);
+
+ if (hSvc)
+ {
+ // try to stop the service
+ if ( ControlService( hSvc, SERVICE_CONTROL_STOP, &ServiceStatus ) )
+ {
+ printf("Stopping %s.", SVC_DISPLAYNAME);
+ Sleep( 1000 );
+
+ while ( QueryServiceStatus( hSvc, &ServiceStatus ) )
+ {
+ if ( ServiceStatus.dwCurrentState == SERVICE_STOP_PENDING )
+ {
+ printf(".");
+ Sleep( 1000 );
+ }
+ else
+ break;
+ }
+
+ if ( ServiceStatus.dwCurrentState == SERVICE_STOPPED )
+ printf("\n%s stopped.\n", SVC_DISPLAYNAME );
+ else
+ printf("\n%s failed to stop.\n", SVC_DISPLAYNAME );
}
// now remove the service
local_hinstance = hInstance;
if (strlen(lpCmdLine) == 0) {
- SERVICE_TABLE_ENTRY ServiceTable[2];
- ServiceTable[0].lpServiceName = SVC_NAME;
- ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)ServiceMain;
-
- ServiceTable[1].lpServiceName = NULL;
- ServiceTable[1].lpServiceProc = NULL;
-
- DBGPRINT(("XenSvc: starting ctrl dispatcher "));
-
- // Start the control dispatcher thread for our service
- if (!StartServiceCtrlDispatcher(ServiceTable))
- {
- int err = GetLastError();
- if (GetLastError() == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT)
- {
- DBGPRINT(("XenSvc: unable to start ctrl dispatcher - %d", GetLastError()));
- }
- }
- else
- {
- // We get here when the service is shut down.
- }
+ SERVICE_TABLE_ENTRY ServiceTable[2];
+ ServiceTable[0].lpServiceName = SVC_NAME;
+ ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)ServiceMain;
+
+ ServiceTable[1].lpServiceName = NULL;
+ ServiceTable[1].lpServiceProc = NULL;
+
+ DBGPRINT(("XenSvc: starting ctrl dispatcher "));
+
+ // Start the control dispatcher thread for our service
+ if (!StartServiceCtrlDispatcher(ServiceTable))
+ {
+ int err = GetLastError();
+ if (GetLastError() == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT)
+ {
+ DBGPRINT(("XenSvc: unable to start ctrl dispatcher - %d", GetLastError()));
+ }
+ }
+ else
+ {
+ // We get here when the service is shut down.
+ }
} else if (!strcmp(lpCmdLine, "-u") || !strcmp(lpCmdLine, "\"-u\"")) {
ServiceUninstall();
} else {
}
enum XShutdownType {
- XShutdownPoweroff,
- XShutdownReboot,
- XShutdownSuspend,
+ XShutdownPoweroff,
+ XShutdownReboot,
+ XShutdownSuspend,
XShutdownS3
};
static BOOL maybeReboot(void *ctx)
{
- char *shutdown_type;
- BOOL res;
- enum XShutdownType type;
+ char *shutdown_type;
+ BOOL res;
+ enum XShutdownType type;
int cntr = 0;
HANDLE eventLog;
XsLog("Check if we need to shutdown");
- if (XenstoreRead("control/shutdown", &shutdown_type) < 0) {
+ if (XenstoreRead("control/shutdown", &shutdown_type) < 0) {
XsLog("No need to shutdown");
- return true;
+ return true;
+ }
+ XsLog("Shutdown type %s\n", shutdown_type);
+ if (strcmp(shutdown_type, "poweroff") == 0 ||
+ strcmp(shutdown_type, "halt") == 0) {
+ type = XShutdownPoweroff;
+ } else if (strcmp(shutdown_type, "reboot") == 0) {
+ type = XShutdownReboot;
+ } else if (strcmp(shutdown_type, "hibernate") == 0) {
+ type = XShutdownSuspend;
+ } else if (strcmp(shutdown_type, "s3") == 0) {
+ type = XShutdownS3;
+ } else {
+ DBGPRINT(("Bad shutdown type %s\n", shutdown_type));
+ goto out;
}
- XsLog("Shutdown type %s\n", shutdown_type);
- if (strcmp(shutdown_type, "poweroff") == 0 ||
- strcmp(shutdown_type, "halt") == 0) {
- type = XShutdownPoweroff;
- } else if (strcmp(shutdown_type, "reboot") == 0) {
- type = XShutdownReboot;
- } else if (strcmp(shutdown_type, "hibernate") == 0) {
- type = XShutdownSuspend;
- } else if (strcmp(shutdown_type, "s3") == 0) {
- type = XShutdownS3;
- } else {
- DBGPRINT(("Bad shutdown type %s\n", shutdown_type));
- goto out;
- }
XsLog("Report Shutdown Event");
- /* We try to shutdown even if this fails, since it might work
- and it can't do any harm. */
- AcquireSystemShutdownPrivilege();
+ /* We try to shutdown even if this fails, since it might work
+ and it can't do any harm. */
+ AcquireSystemShutdownPrivilege();
eventLog = RegisterEventSource(NULL, "xensvc");
if (eventLog) {
XsLog("Do the shutdown");
- /* do the shutdown */
- switch (type) {
- case XShutdownPoweroff:
- case XShutdownReboot:
+ /* do the shutdown */
+ switch (type) {
+ case XShutdownPoweroff:
+ case XShutdownReboot:
if (WindowsVersion >= 0x500 && WindowsVersion < 0x600)
{
/* Windows 2000 InitiateSystemShutdownEx is funny in
InitiateSystemShutdownEx behaves so badly. */
/* If this is a legacy hal then use EWX_SHUTDOWN when shutting
down instead of EWX_POWEROFF. */
- /* Similar problem on XP. Shutdown/Reboot will hang until the Welcome
- screen screensaver is dismissed by the guest */
+ /* Similar problem on XP. Shutdown/Reboot will hang until the Welcome
+ screen screensaver is dismissed by the guest */
#pragma warning (disable : 28159)
res = ExitWindowsEx((type == XShutdownReboot ?
EWX_REBOOT :
#pragma warning (default: 28159)
if (!res) {
PrintError("ExitWindowsEx");
- return false;
- }
+ return false;
+ }
else
{
- if (XenstoreRemove("control/shutdown"))
- return false;
- }
+ if (XenstoreRemove("control/shutdown"))
+ return false;
+ }
} else {
#pragma warning (disable : 28159)
res = InitiateSystemShutdownEx(
#pragma warning (default: 28159)
if (!res) {
PrintError("InitiateSystemShutdownEx");
- return false;
+ return false;
} else {
if (XenstoreRemove("control/shutdown"))
- return false;
+ return false;
}
}
- break;
- case XShutdownSuspend:
+ break;
+ case XShutdownSuspend:
if (XenstorePrintf ("control/hibernation-state", "started"))
- return false;
+ return false;
/* Even if we think hibernation is disabled, try it anyway.
It's not like it can do any harm. */
- res = SetSystemPowerState(FALSE, FALSE);
+ res = SetSystemPowerState(FALSE, FALSE);
if (XenstoreRemove ("control/shutdown"))
- {
- return false;
- }
+ {
+ return false;
+ }
if (!res) {
/* Tell the tools that we've failed. */
PrintError("SetSystemPowerState");
if (XenstorePrintf ("control/hibernation-state", "failed"))
- return false;
+ return false;
}
- break;
+ break;
case XShutdownS3:
if (XenstorePrintf ("control/s3-state", "started"))
- return false;
+ return false;
res = SetSuspendState(FALSE, TRUE, FALSE);
XenstoreRemove ("control/shutdown");
if (!res) {
PrintError("SetSuspendState");
if (XenstorePrintf ("control/s3-state", "failed"))
- return false;
+ return false;
}
break;
- }
+ }
out:
- XenstoreFree(shutdown_type);
- return true;
+ XenstoreFree(shutdown_type);
+ return true;
}
/* We need to resync the clock when we recover from suspend/resume. */
DBGPRINT(("Coming back from suspend.\n"));
GetXenTime(&now);
- if ((now.dwLowDateTime == 0) && (now.dwHighDateTime == 0)) {
- XsLog("Cannot set system time to xentime, unable to contact WMI");
- return;
- }
+ if ((now.dwLowDateTime == 0) && (now.dwHighDateTime == 0)) {
+ XsLog("Cannot set system time to xentime, unable to contact WMI");
+ return;
+ }
XsLog("Xen time is %I64x", now);
if (!FileTimeToSystemTime(&now, &sys_time)) {
PrintError("FileTimeToSystemTime()");
struct watch_feature_set features;
BOOL snap = FALSE;
- OutputDebugString("Trying to connect to WMI\n");
- while (!ConnectToWMI()) {
- OutputDebugString("Unable to connect to WMI, sleeping\n");
- if (WaitForSingleObject(hServiceExitEvent, 1000*10) == WAIT_OBJECT_0) {
- exit = true;
- return exit;
- }
- }
- while (InitXSAccessor()==false) {
- OutputDebugString("Unable to initialise WMI session, sleeping\n");
- if (WaitForSingleObject(hServiceExitEvent, 1000*10) == WAIT_OBJECT_0) {
- exit = true;
- return exit;
- }
- }
+ OutputDebugString("Trying to connect to WMI\n");
+ while (!ConnectToWMI()) {
+ OutputDebugString("Unable to connect to WMI, sleeping\n");
+ if (WaitForSingleObject(hServiceExitEvent, 1000*10) == WAIT_OBJECT_0) {
+ exit = true;
+ return exit;
+ }
+ }
+ while (InitXSAccessor()==false) {
+ OutputDebugString("Unable to initialise WMI session, sleeping\n");
+ if (WaitForSingleObject(hServiceExitEvent, 1000*10) == WAIT_OBJECT_0) {
+ exit = true;
+ return exit;
+ }
+ }
XsLog("Guest agent lite main loop starting");
memset(&features, 0, sizeof(features));
- HANDLE wmierrorEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ HANDLE wmierrorEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (!wmierrorEvent) {
PrintError("CreateEvent() wmierrorEvent");
- return exit;
+ return exit;
}
XsLog("About to add feature shutdown");
if (!AddFeature(&features, "control/shutdown", "control/feature-shutdown",
- "shutdown", maybeReboot, NULL, wmierrorEvent)) {
- return exit;
- }
+ "shutdown", maybeReboot, NULL, wmierrorEvent)) {
+ return exit;
+ }
suspendEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (!suspendEvent) {
PrintError("CreateEvent() suspendEvent");
- return exit;
+ return exit;
}
-
+
if (ListenSuspend(suspendEvent, wmierrorEvent) < 0) {
- PrintError("ListenSuspend()");
- CloseHandle(suspendEvent);
- suspendEvent = NULL;
- return exit;
+ PrintError("ListenSuspend()");
+ CloseHandle(suspendEvent);
+ suspendEvent = NULL;
+ return exit;
}
AdvertiseFeatures(&features);
XsLog("About to kick xapi ");
- XenstoreKickXapi();
+ XenstoreKickXapi();
while (1)
{
unsigned x;
handles[0] = hServiceExitEvent;
- if (wmierrorEvent)
- handles[nr_handles++] = wmierrorEvent;
+ if (wmierrorEvent)
+ handles[nr_handles++] = wmierrorEvent;
if (suspendEvent)
handles[nr_handles++] = suspendEvent;
for (x = 0; x < features.nr_features; x++)
if (event == hServiceExitEvent)
{
XsLog("service exit event");
- exit = true;
+ exit = true;
break;
}
else if (event == suspendEvent)
XsLog("Suspend event");
finishSuspend();
AdvertiseFeatures(&features);
- XenstoreKickXapi();
+ XenstoreKickXapi();
XsLog("Handled suspend event");
}
- else if (event == wmierrorEvent)
- {
- break;
- }
+ else if (event == wmierrorEvent)
+ {
+ break;
+ }
else
{
- BOOL fail = false;
+ BOOL fail = false;
for (x = 0; x < features.nr_features; x++) {
if (features.features[x].watch->event == event) {
XsLog("Fire %p",features.features[x].name);
XsLog("fire feature %s", features.features[x].name);
- OutputDebugString("Event triggered\n");
+ OutputDebugString("Event triggered\n");
if (!(features.features[x].handler(features.features[x].ctx)))
- {
+ {
XsLog("Firing feature failed");
- PrintError("Feature failed");
- fail = true;
- }
+ PrintError("Feature failed");
+ fail = true;
+ }
XsLog("fired feature %s",
features.features[x].name);
}
}
- if (fail) {
+ if (fail) {
XsLog("Resetting");
- break;
+ break;
}
}
}
break;
}
}
- OutputDebugString("WMI Watch loop terminated\n");
- RemoveFeatures(&features);
- XenstoreKickXapi();
+ OutputDebugString("WMI Watch loop terminated\n");
+ RemoveFeatures(&features);
+ XenstoreKickXapi();
XsLog("Guest agent lite loop finishing");
ReleaseWMIAccessor(&wmi);
XsLog("Guest agent lite loop finished %d", exit);
- return exit;
+ return exit;
}
// Service initialization
bool ServiceInit()
{
- ServiceStatus.dwServiceType = SERVICE_WIN32;
+ ServiceStatus.dwServiceType = SERVICE_WIN32;
ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
ServiceStatus.dwControlsAccepted =
SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN |
ServiceStatus.dwWaitHint = 0;
hStatus = RegisterServiceCtrlHandlerEx(
- "XenService",
- ServiceControlHandler,
+ "XenService",
+ ServiceControlHandler,
NULL);
if (hStatus == (SERVICE_STATUS_HANDLE)0)
{
// Registering Control Handler failed
- DBGPRINT(("XenSvc: Registering service control handler failed - %d\n", GetLastError()));
+ DBGPRINT(("XenSvc: Registering service control handler failed - %d\n", GetLastError()));
return false;
}
- ServiceStatus.dwCurrentState = SERVICE_RUNNING;
- SetServiceStatus (hStatus, &ServiceStatus);
+ ServiceStatus.dwCurrentState = SERVICE_RUNNING;
+ SetServiceStatus (hStatus, &ServiceStatus);
- return true;
+ return true;
}
void WINAPI ServiceMain(int argc, char** argv)
DBGPRINT(("XenSvc: Unable to init xenservice\n"));
return;
}
- BOOL stopping;
-
- do {
-
- __try
- {
- stopping = Run();
-
- }
- __except(EXCEPTION_EXECUTE_HANDLER)
- {
- }
- } while (!stopping);
-
+ BOOL stopping;
+
+ do {
+
+ __try
+ {
+ stopping = Run();
+
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ }
+ } while (!stopping);
+
XsLog("Guest agent service stopped");
ShutdownXSAccessor();
- ServiceControlManagerUpdate(0, SERVICE_STOPPED);
+ ServiceControlManagerUpdate(0, SERVICE_STOPPED);
return;
}
return NO_ERROR;
default:
- DBGPRINT(("XenSvc: unknown request."));
+ DBGPRINT(("XenSvc: unknown request."));
break;
}