HRESULT hr = RoActivateInstance(HString::MakeReference(RuntimeClass_Windows_Management_Deployment_PackageManager).Get(),
&packageManager);
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to instantiate package manager. HRESULT: 0x" << QByteArray::number(hr, 16).constData();
+ qCWarning(lcD3DService) << "Unable to instantiate package manager:" << qt_error_string(hr);
return 1;
}
ComPtr<IPackage> package;
hr = packageManager->FindPackageByUserSecurityIdPackageFullName(NULL, packageFullName.Get(), &package);
if (FAILED(hr)) {
- qCWarning(lcD3DService).nospace() << "Unable to query package. HRESULT: 0x"
- << QByteArray::number(hr, 16).constData();
+ qCWarning(lcD3DService) << "Unable to query package:" << qt_error_string(hr);
return 1;
}
if (!package) {
ComPtr<IPackageId> packageId;
hr = package->get_Id(&packageId);
if (FAILED(hr)) {
- qCWarning(lcD3DService).nospace() << "Unable to get package ID. HRESULT: 0x"
- << QByteArray::number(hr, 16).constData();
+ qCWarning(lcD3DService) << "Unable to get package ID:" << qt_error_string(hr);
return 1;
}
HSTRING packageFamilyName;
hr = packageId->get_FamilyName(&packageFamilyName);
if (FAILED(hr)) {
- qCWarning(lcD3DService).nospace() << "Unable to get package name. HRESULT: 0x"
- << QByteArray::number(hr, 16).constData();
+ qCWarning(lcD3DService) << "Unable to get package name:" << qt_error_string(hr);
return 1;
}
Customer = 0x20000000
};
struct {
- ushort facility : 2;
- ushort code : 2;
+ ushort facility;
+ ushort code;
};
ulong val;
};
if (eventSource) {
if (type > QtDebugMsg) {
ErrorId id = { ushort(FACILITY_NULL | ErrorId::Customer), type };
+ WORD eventType;
switch (type) {
default:
case 1:
id.facility |= ErrorId::Informational;
+ eventType = EVENTLOG_SUCCESS;
break;
case 2:
id.facility |= ErrorId::Warning;
+ eventType = EVENTLOG_WARNING_TYPE;
break;
case 3:
id.facility |= ErrorId::Error;
+ eventType = EVENTLOG_ERROR_TYPE;
break;
}
- ReportEvent(eventSource, type, 0, id.val, NULL, 2, 0, strings, NULL);
+ ReportEvent(eventSource, eventType, 0, id.val, NULL, 2, 0, strings, NULL);
DeregisterEventSource(eventSource);
}
}
hr = coreConServer->handle()->GetConnection(
device->handle(), 5000, NULL, connectionName.GetAddress(), &connection);
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to initialize connection."
+ qCWarning(lcD3DService) << "Unable to initialize connection:"
<< coreConServer->formatError(hr);
return 1;
}
ComPtr<ICcConnection3> connection3;
hr = connection.As(&connection3);
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to obtain connection3 interface."
+ qCWarning(lcD3DService) << "Unable to obtain connection3 interface:"
<< coreConServer->formatError(hr);
return 1;
}
ComPtr<ICcConnection4> connection4;
hr = connection.As(&connection4);
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to obtain connection4 interface."
+ qCWarning(lcD3DService) << "Unable to obtain connection4 interface:"
<< coreConServer->formatError(hr);
return 1;
}
VARIANT_BOOL connected;
hr = connection->IsConnected(&connected);
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to query connection state."
+ qCWarning(lcD3DService) << "Unable to query connection state:"
<< coreConServer->formatError(hr);
Sleep(1000);
continue;
hr = connection->ConnectDevice();
connected = SUCCEEDED(hr);
if (connected) {
- qCDebug(lcD3DService) << "Connected.";
+ qCWarning(lcD3DService).nospace() << "Connected to " << device->name() << ".";
wasDisconnected = true;
}
if (FAILED(hr)) {
while (!isInstalled) {
hr = connection3->IsApplicationInstalled(bstr(app), &isInstalled);
if (FAILED(hr)) {
- qCCritical(lcD3DService) << "Unable to determine if package is installed - check that the app option contains a valid UUID."
+ qCCritical(lcD3DService) << "Unable to determine if package is installed:"
<< coreConServer->formatError(hr);
return 1;
}
hr = connection->GetFileInfo(bstr(remoteControlFile), &controlFileInfo);
if (FAILED(hr)) {
if (hr != 0x80070003 /* Not found */) {
- qCWarning(lcD3DService) << "Unable to obtain file info"
+ qCWarning(lcD3DService) << "Unable to obtain file info:"
<< coreConServer->formatError(hr);
Sleep(1000);
continue;
// Not found, so let's upload it
hr = connection->SendFile(bstr(localControlFile), bstr(remoteControlFile), 2, 2, NULL);
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to send control file."
- << coreConServer->formatError(hr);
- wasDisconnected = true;
- Sleep(1000);
+ if (hr == 0x8973190e) {
+ // This can happen during normal reinstallation, so continue
+ qCDebug(lcD3DService) << "Unable to send control file, retrying...";
+ wasDisconnected = true;
+ Sleep(1000);
+ } else {
+ qCWarning(lcD3DService) << "Unable to send control file:"
+ << coreConServer->formatError(hr);
+ return 1;
+ }
continue;
}
}
hr = connection->GetFileInfo(bstr(remoteSourcePath), &remoteDirectoryInfo);
if (FAILED(hr)) {
if (hr != 0x80070002 && hr != 0x80070003 /* Not found */) {
- qCWarning(lcD3DService) << "Unable to get remote directory info."
+ qCWarning(lcD3DService) << "Unable to get remote directory info:"
<< coreConServer->formatError(hr);
Sleep(1000);
continue;
// Not found, create remote source path
hr = connection->MakeDirectory(bstr(remoteSourcePath));
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to create the shader source directory."
+ qCWarning(lcD3DService) << "Unable to create the shader source directory:"
<< coreConServer->formatError(hr);
continue;
}
hr = connection->GetFileInfo(bstr(remoteBinaryPath), &remoteDirectoryInfo);
if (FAILED(hr)) {
if (hr != 0x80070002 && hr != 0x80070003 /* Not found */) {
- qCWarning(lcD3DService) << "Unable to get remote directory info."
+ qCWarning(lcD3DService) << "Unable to get remote directory info:"
<< coreConServer->formatError(hr);
Sleep(1000);
continue;
// Not found, create remote source path
hr = connection->MakeDirectory(bstr(remoteBinaryPath));
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to create the shader source directory."
+ qCWarning(lcD3DService) << "Unable to create the shader source directory:"
<< coreConServer->formatError(hr);
continue;
}
hr = connection->SetFileInfo(bstr(remoteControlFile), &controlFileInfo);
round = 1;
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to update control file"
+ qCWarning(lcD3DService) << "Unable to update control file:"
<< coreConServer->formatError(hr);
Sleep(1000);
continue;
SAFEARRAY *listing;
hr = connection4->GetDirectoryListing(bstr(remoteSourcePath), &listing);
if (FAILED(hr)) {
- qCWarning(lcD3DService) << "Unable to get the shader source directory listing"
+ qCWarning(lcD3DService) << "Unable to get the shader source directory listing:"
<< coreConServer->formatError(hr);
wasDisconnected = true;
Sleep(1000);