mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
fix errors when calling CfRegisterSyncRoot by setting more fields
sets a reasonable size of the StructSize members in the struct passed to CfRegisterSyncRoot function Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
This commit is contained in:
parent
5404c8cd2a
commit
97d785f1bb
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <QFileInfo>
|
||||
#include <QLocalSocket>
|
||||
#include <QLoggingCategory>
|
||||
#include <QUuid>
|
||||
|
||||
#include <sddl.h>
|
||||
#include <cfapi.h>
|
||||
|
@ -467,14 +468,17 @@ OCC::Result<void, QString> OCC::CfApiWrapper::registerSyncRoot(const QString &pa
|
|||
const auto version = std::wstring(providerVersion.toStdWString().data());
|
||||
|
||||
CF_SYNC_REGISTRATION info;
|
||||
info.StructSize = sizeof(info) + (name.length() + version.length()) * sizeof(wchar_t);
|
||||
info.ProviderName = name.data();
|
||||
info.ProviderVersion = version.data();
|
||||
info.SyncRootIdentity = nullptr;
|
||||
info.SyncRootIdentityLength = 0;
|
||||
info.FileIdentity = nullptr;
|
||||
info.FileIdentityLength = 0;
|
||||
info.ProviderId = QUuid::createUuid();
|
||||
|
||||
CF_SYNC_POLICIES policies;
|
||||
policies.StructSize = sizeof(policies);
|
||||
policies.Hydration.Primary = CF_HYDRATION_POLICY_FULL;
|
||||
policies.Hydration.Modifier = CF_HYDRATION_POLICY_MODIFIER_NONE;
|
||||
policies.Population.Primary = CF_POPULATION_POLICY_ALWAYS_FULL;
|
||||
|
|
Loading…
Reference in a new issue