diff options
Diffstat (limited to 'qga')
-rw-r--r-- | qga/commands-posix.c | 8 | ||||
-rw-r--r-- | qga/guest-agent-core.h | 2 | ||||
-rw-r--r-- | qga/vss-win32/install.cpp | 16 |
3 files changed, 15 insertions, 11 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 10682f58dc..8100bee67e 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -401,7 +401,7 @@ int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, E return -1; } - slog("guest-file-open, handle: %d", handle); + slog("guest-file-open, handle: %" PRId64, handle); return handle; } @@ -410,7 +410,7 @@ void qmp_guest_file_close(int64_t handle, Error **err) GuestFileHandle *gfh = guest_file_handle_find(handle, err); int ret; - slog("guest-file-close called, handle: %ld", handle); + slog("guest-file-close called, handle: %" PRId64, handle); if (!gfh) { return; } @@ -451,7 +451,7 @@ struct GuestFileRead *qmp_guest_file_read(int64_t handle, bool has_count, read_count = fread(buf, 1, count, fh); if (ferror(fh)) { error_setg_errno(err, errno, "failed to read file"); - slog("guest-file-read failed, handle: %ld", handle); + slog("guest-file-read failed, handle: %" PRId64, handle); } else { buf[read_count] = 0; read_data = g_malloc0(sizeof(GuestFileRead)); @@ -496,7 +496,7 @@ GuestFileWrite *qmp_guest_file_write(int64_t handle, const char *buf_b64, write_count = fwrite(buf, 1, count, fh); if (ferror(fh)) { error_setg_errno(err, errno, "failed to write to file"); - slog("guest-file-write failed, handle: %ld", handle); + slog("guest-file-write failed, handle: %" PRId64, handle); } else { write_data = g_malloc0(sizeof(GuestFileWrite)); write_data->count = write_count; diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h index 624a559d94..e422208b4e 100644 --- a/qga/guest-agent-core.h +++ b/qga/guest-agent-core.h @@ -29,7 +29,7 @@ GACommandState *ga_command_state_new(void); bool ga_logging_enabled(GAState *s); void ga_disable_logging(GAState *s); void ga_enable_logging(GAState *s); -void slog(const gchar *fmt, ...); +void GCC_FMT_ATTR(1, 2) slog(const gchar *fmt, ...); void ga_set_response_delimited(GAState *s); bool ga_is_frozen(GAState *s); void ga_set_frozen(GAState *s); diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index 37731a7271..b791a6c33b 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -25,8 +25,8 @@ extern HINSTANCE g_hinstDll; const GUID CLSID_COMAdminCatalog = { 0xF618C514, 0xDFB8, 0x11d1, {0xA2, 0xCF, 0x00, 0x80, 0x5F, 0xC7, 0x92, 0x35} }; -const GUID IID_ICOMAdminCatalog = { 0xDD662187, 0xDFC2, 0x11d1, - {0xA2, 0xCF, 0x00, 0x80, 0x5F, 0xC7, 0x92, 0x35} }; +const GUID IID_ICOMAdminCatalog2 = { 0x790C6E0B, 0x9194, 0x4cc9, + {0x94, 0x26, 0xA4, 0x8A, 0x63, 0x18, 0x56, 0x96} }; const GUID CLSID_WbemLocator = { 0x4590f811, 0x1d3a, 0x11d0, {0x89, 0x1f, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} }; const GUID IID_IWbemLocator = { 0xdc12a687, 0x737f, 0x11cf, @@ -141,7 +141,7 @@ static HRESULT QGAProviderFind( HRESULT hr; COMInitializer initializer; COMPointer<IUnknown> pUnknown; - COMPointer<ICOMAdminCatalog> pCatalog; + COMPointer<ICOMAdminCatalog2> pCatalog; COMPointer<ICatalogCollection> pColl; COMPointer<ICatalogObject> pObj; _variant_t var; @@ -149,7 +149,7 @@ static HRESULT QGAProviderFind( chk(CoCreateInstance(CLSID_COMAdminCatalog, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void **)pUnknown.replace())); - chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog, + chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog2, (void **)pCatalog.replace())); chk(pCatalog->GetCollection(_bstr_t(L"Applications"), (IDispatch **)pColl.replace())); @@ -206,7 +206,7 @@ STDAPI COMRegister(void) HRESULT hr; COMInitializer initializer; COMPointer<IUnknown> pUnknown; - COMPointer<ICOMAdminCatalog> pCatalog; + COMPointer<ICOMAdminCatalog2> pCatalog; COMPointer<ICatalogCollection> pApps, pRoles, pUsersInRole; COMPointer<ICatalogObject> pObj; long n; @@ -229,7 +229,7 @@ STDAPI COMRegister(void) chk(CoCreateInstance(CLSID_COMAdminCatalog, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void **)pUnknown.replace())); - chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog, + chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog2, (void **)pCatalog.replace())); /* Install COM+ Component */ @@ -273,6 +273,10 @@ STDAPI COMRegister(void) goto out; } + chk(pCatalog->CreateServiceForApplication( + _bstr_t(QGA_PROVIDER_LNAME), _bstr_t(QGA_PROVIDER_LNAME), + _bstr_t(L"SERVICE_AUTO_START"), _bstr_t(L"SERVICE_ERROR_NORMAL"), + _bstr_t(L""), _bstr_t(L".\\localsystem"), _bstr_t(L""), FALSE)); chk(pCatalog->InstallComponent(_bstr_t(QGA_PROVIDER_LNAME), _bstr_t(dllPath), _bstr_t(tlbPath), _bstr_t(""))); |