Using CSISyncClient to control the Office Document Cache (ODC)

Office 2013 and later

Learn how to use CSISyncClient to control the Office Document Cache (ODC).

Last modified: July 13, 2015

CSISyncClient is an out-of-proc COM server (CsiSyncClient.exe) that allows Microsoft OneDrive to control the behavior of the Office Document Cache (ODC). For example, OneDrive may call upon the ODC via CSISyncClient to upload and download files to and from MS-FSSHTTP enabled endpoints. This enables advanced service-backed features in Office, such as co-authoring and seamless transitions from offline to online.

CsiSyncClient is available in Office Desktop (both x86 and x64). Note: While newer versions of Office may ship with CsiSyncClient, the process will be used for backward compatibility only. The CsiSyncClient interface and the methodology of controlling the ODC will change in future versions of Office.

The class ID is currently set to respond only to OneDrive.

The COM object is usable as an out-of-proc COM server and runs in CsiSyncClient.exe. Due to limitations with Access (which the ODC uses), it ships with the bit type that Office comes in, so x64 Office means an x64 COM object, or x86 Office means an x86 COM object. To get around this limitation, specifying CLSCTX_LOCAL_SERVER as part of the CoCreateInstance will have the COM object be hosted as an out-of-proc COM server, allowing cross-bitness compatibility.

CSISyncClient uses the following interfaces.

Interface ILSCLocalSyncClient

This is the primary interface used to synchronize files in Office.

ProgID: Office.LocalSyncClient

CLSID: {14286318-B6CF-49a1-81FC-D74AD94902F9}

TypeLib: {66CDD37F-D313-4e81-8C31-4198F3E42C3C}

The COM object that is exposed is used as an out-of-proc server. Specifying CLSCTX_LOCAL_SERVER as part of CoCreateInstance allows compatability between 64bit and 32bit processes.

Once you've co-created the COM object, you MUST call ILSCLocalSyncClient::Initialize first. Once ILSCLocalSyncClient::Initialize has completed successfully, you may call any API as often as you wish and in any order. You may also call ILSCLocalSyncClient::Initialize on an already initialized object, but this does nothing.

The exceptions to the previous paragraph are ILSCLocalSyncClient::ResetCache and ILSCLocalSyncClient::Uninitialize . After you call ILSCLocalSyncClient::Uninitialize on the COM object, you MUST destroy that object and create a new one. ILSCLocalSyncClient::ResetCache will delete your subcache, delete all associated file information in the cache, but leave the documents on disk. It also leaves the state intact for communicating with the cache. This allows you to call ILSCLocalSyncClient::Initialize again to create a new cache without having to destroy and recreate the COM object.

Public Member Functions

ILSCLocalSyncClient::DeleteFile

DeleteFile is used to remove the file information from the cache. However, this method will leave the associated file on disk and on the server.

HRESULT ILSCLocalSyncClient::DeleteFile ( [in] BSTR bstrResourceID )

Parameters

bstrResourceID

The string which identifies the ResourceID of the file. This value must be non-empty with a maximum of 128 characters.

Return values

Value

Description

E_FAIL

The call failed.

E_INVALIDARG

One or more parameters are invalid.

E_FAIL

The call failed.

E_LSC_FILENOTFOUND

The given ResourceID is not in the cache.

E_LSC_NOTINITIALIZED

Initialize has not been successfully called in the past.

E_LSC_PENDINGCHANGESINCACHE

The file is currently synchronizing or open and cannot be deleted.

S_OK

The call succeeded.

ILSCLocalSyncClient::GetChanges

GetChanges returns an enumerator of ILSCEvent objects, and also returns a token that is given to the next call to GetChanges, assuming the consumer has processed the previous set of events. Events before the nPreviousChangesToken specified will be deleted and unavailable. If there are no events to be processed, pnCurrentChangesToken should be the same value as nPreviousChangesToken, but ppiEvents will still be set.

HRESULT ILSCLocalSyncClient::GetChanges ( [in] LONG nPreviousChangesToken, [out] LONG * pnCurrentChangesToken, [out] IEnumLSCEvent ** ppiEvents )

Parameters

nPreviousChangesToken

Identifies which event was last processed by the consumer.

pnCurrentChangesToken

Identifies the most recent event being handed to the consumer. Must not be null.

ppiEvents

An enumerator for the events handed to the consumer. Must not be null.

Return values

Value

Description

E_FAIL

The call failed.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_NOTINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

S_OK

The call succeeded.

ILSCLocalSyncClient::GetClientNetworkSyncPermission

GetClientNetworkSyncPermission is used to query whether Office's synchronizing heuristics for network cost and power usage are overridden. When on a 3G or other high cost network, or when running on battery versus being plugged in, Office may choose to block network traffic until a more opportune time.

HRESULT ILSCLocalSyncClient::GetClientNetworkSyncPermission ( [in] LSCNetworkSyncPermissionType nspType, [out] VARIANT_BOOL * pfSyncEnabled )

Parameters

nspType

A flag which defines which cost heuristic to query. See Enum LSCNetworkSyncPermissionType .

pfSyncEnabled

Specifies whether the requested cost heuristic is currently overridden or not. Must not be null.

Return values

Value

Description

E_FAIL

The call failed.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_NOTINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

S_OK

The call succeeded.

ILSCLocalSyncClient::GetFileStatus

GetFileStatus is used to gather information for a specific file: whether it exists in the cache, if it has pending communication with the server copy, and if Office 2013 has the most up to date data from the local copy. It requires a bitwise flag of Enum LSCStatusFlag values to determine what information the CsiSyncClient COM object is to query for.

HRESULT ILSCLocalSyncClient::GetFileStatus ( [in] BSTR bstrResourceID, [in] LSCStatusFlag sfRequestedStatus, [out] BSTR * pbstrFileSystemPath, [out] BSTR * pbstrETag, [out] LSCStatusFlag * psfFileStatus )

Parameters

bstrResourceID

The string which identifies the file on the client. This value must be non-empty, with a maximum of 128 characters.

sfRequestedStatus

A flag which defines what information to return. See Enum LSCStatusFlag .

pbstrFileSystemPath

The string which identifies the location of the file identified by bstrResourceID on the client. Must not be null.

pbstrETag

A string which will contain the eTag for the file identified by bstrResourceID. Must not be null.

psfFileStatus

A flag which will contain the status requested via sfRequestedStatus for the file identified by bstrResourceID. Must not be null. See Enum LSCStatusFlag .

Return values

Value

Description

E_FAIL

The call failed.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_FILENOTFOUND

The file information specified by bstrResourceID does not exist in the cache.

E_LSC_LOCALFILEUNAVAILABLE

LSCStatusFlag_LocalFileUnchanged was requested or the file specified by bstrResourceID is locked or missing.

E_LSC_NOTINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

S_OK

The call succeeded.

ILSCLocalSyncClient::GetSupportedFileExtensions

GetSupportedFileExtensions returns a list of pipe-delimited file extensions which are currently supported by the CsiSyncClient COM object. Note that this list may change, and the consumer will be notified of a change via the IPartnerActivityCallback object provided on ILSCLocalSyncClient::Initialize (See EventOccured).

An example of the string returned is as follows: "|docx|docm|pptx|"

HRESULT ILSCLocalSyncClient::GetSupportedFileExtensions ( [out] BSTR * pbstrSupportedFileExtensions )

Parameters

pbstrSupportedFileExtensions

A string to be set with a pipe-delimited set of file extensions supported by the CsiSyncClient COM object. Must not be null.

Return values

Value

Description

E_FAIL

The call failed.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_NOTINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

S_OK

The call succeeded.

ILSCLocalSyncClient::Initialize

Initialize must be the first method called. Otherwise, all other APIs will return E_LSC_NOTINITIALIZED. Calling Initialize on an already initialized object returns S_OK and does nothing. If E_LSC_CACHEMISMATCH is returned, the caller may call ILSCLocalSyncClient::ResetCache to delete the cache associated with the given SuppliedID. However, in this case other APIs will still return E_LSC_NOTINITIALIZED.

HRESULT ILSCLocalSyncClient::Initialize ( [in] BSTR bstrSuppliedID, [in] BSTR bstrProgID, [in] BSTR bstrFileSystemDirectoryHint, [in] IPartnerActivityCallback * pEventCallback, [out] VARIANT_BOOL * pfCreatedNewCache )

Parameters

bstrSuppliedID

Identifies the consumer and which cache to use. Must be non-empty with a maximum of 32 characters.

bstrProgID

Identifies the consumer's COM object for two-way communication. Must be non-empty with a maximum of 39 characters. See <ProgID> Key for more information on ProgIDs.

bstrFileSystemDirectoryHint

Identifies the directory root in which local files will be stored. Must be non-empty with a maximum of 256 characters. The directory must already exist.

pEventCallback

The callback interface which CsiSyncClient will notify on changes. See IPartnerActivityCallback::EventOccurred. This value must not be null.

pfCreatedNewCache

Returns whether a new cache was created. If no cache is associated with the SuppliedID, one will be created. This value must not be null.

Return values

Value

Description

E_FAIL

The call failed.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_CACHEMISMATCH

A SuppliedID already has a cache associated with it, but has a different ProgId or FileSystemDirectoryHint than the ones provided.

E_LSC_DIRECTORYHINTCONFLICT

The FileSystemDirectoryHint (or a subfolder) already exists on a different cache.

E_LAC_PROGIDCONFLICT

The ProgID already exists on a different cache.

S_OK

The call succeeded.

ILSCLocalSyncClient::LocalFileChange

LocalFileChange is used to tell the CsiSyncClient COM object to attempt to upload the specified file. The method will prepare the file for upload, including reading the file's current contents. If an upload is already pending, the previous upload will be discarded and the new contents prepared for upload. If the file is open for editing in an application, this method will return S_OK without preparing the file for upload (the application should already do this step if there are changes).

This method will allow uploads if it was marked as uploads blocked previously (see ILSCLocalSyncClient::RenameFile ).

HRESULT ILSCLocalSyncClient::LocalFileChange ( [in] BSTR bstrFileSystemPath, [in] BSTR bstrWebPath, [in] BSTR bstrResourceID )

Parameters

bstrFileSystemPath

A string which identifies the file on the client. This value must be a non-empty local path with a maximum of 256 characters. This path must be in the directory tree specified by the FileSystemDirectoryHint when the call to ILSCLocalSyncClient::Initialize was made.

bstrResourceID

A string which identifies the ResourceID of the file. This value must be non-empty with a maximum of 128 characters.

bstrWebPath

A string which identifies the file on the server. This value must be non-empty, valid URL, but no longer than INTERNET_MAX_URL_LENGTH, as defined by http://support.microsoft.com/kb/208427.

Return values

Value

Description

E_FAIL

The call failed.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_CONFLICTINGFILE

The file specified by bstrFileSystemPath has a different ResourceID than specified. An event of type LSCEventType_OnFilePathConflict is sent when this error is returned. See ILSCLocalSyncClient::GetChanges .

E_LSC_FILENOTFOUND

The file was deleted mid-operation.

E_LSC_FILENOTSUPPORTED

The given file extension is not supported by the CsiSyncClient COM object. See ILSCLocalSyncClient::GetSupportedFileExtensions .

E_LSC_FILEUPTODATE

The COM object did not schedule an upload because the file in the cache had the most recent changes from the disk.

E_LSC_LOCALFILEUNAVAILABLE

The file specified by bstrFileSystemPath is missing or locked.

E_LSC_LOCALPATHNOTMAPPED

The given FileSystemPath is not under the directory root specified by the FileSystemDirectoryHint when the call to Initialize was made.

E_LSC_NOTINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

E_LSC_PATHMISMATCH

The file specified by bstrResourceID has a different FileSystemPath than specified.

E_LSC_PENDINGCHANGESINCACHE

The file specified already has pending changes in a different cache and cannot yet be associated with the consumer's cache.

E_LSC_SERVERPATHINDIFFERENTCACHE

The WebPath provided falls under a different cache.

S_OK

The call succeeded.

ILSCLocalSyncClient::RenameFile

RenameFile will associate a new URL and local path for a given ResourceID. If the file specified by the ResourceID doesn't already exist in the cache, an attempt will be made to create it and mark it for download.

HRESULT ILSCLocalSyncClient::RenameFile ( [in] BSTR bstrResourceID, [in] BSTR bstrNewFileSystemPath, [in] BSTR bstrNewWebPath, [in] VARIANT_BOOL fBlockUploads )

Parameters

bstrResourceID

A string which identifies the ResourceID of the file. This value must be non-empty with a maximum of 128 characters.

bstrNewFileSystemPath

A string which specifies the new local path for the file. This value must be a non-empty local path with a maximum of 256 characters. This path must be in the directory tree specified by the FileSystemDirectoryHint when the call to Initialize was made.

bstrNewWebPath

A string which specifies the new URL for the file. This value must be non-empty valid URL, but no longer than INTERNET_MAX_URL_LENGTH, as defined by http://support.microsoft.com/kb/208427.

fBlockUploads

Specifies whether uploads to the new location are allowed currently.

Return values

Value

Description

E_FAIL

The call failed.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_CONFLICTINGFILE

The bstrNewFileSystemPath or bstrNewWebPath already exist on another file in any cache. An event of type LSCEventType_OnFilePathConflict is sent when this error is returned. See ILSCLocalSyncClient::GetChanges .

E_LSC_FILENOTFOUND

The file information was deleted from the cache while this method was running.

E_LSC_LOCALPATHNOTMAPPED

The given FileSystemPath is not under the directory root specified by the FileSystemDirectoryHint when the call to Initialize was made.

E_LSC_NOTINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

E_LSC_PENDINGCHANGESINCACHE

The file specified is currently synchronizing in an Office application.

S_OK

The call succeeded.

ILSCLocalSyncClient::ResetCache

ResetCache will delete the cache associated with the SuppliedID that was provided on Initialize. This includes all of the file information, but will leave the files on both the client and the server. This method also leaves the object in a partially uninitialized state. The only valid calls after this are ILSCLocalSyncClient::Initialize or ILSCLocalSyncClient::Uninitialize . This method MAY be called if Initialize fails and returns E_LSC_CACHEMISMATCH, and will delete the cache associated with the SuppliedID that was provided with the failing call.

HRESULT ILSCLocalSyncClient::ResetCache( )

Parameters

None

Return values

Value

Description

E_FAIL

The call failed.

E_LSC_NOTINITIALIZED

ILSCLocalSyncClient::Initialize was not successfully called in the past.

S_OK

The call succeeded.

ILSCLocalSyncClient::ServerFileChange

ServerFileChange tells the CsiSyncClient COM object to mark the specified file for download. If the file is open in an Office application for edit, this method will return S_OK without marking the file for download (the application should already do this step if there are changes).

This method will allow downloads if it was marked as downloads blocked previously (see RenameFile).

HRESULT ILSCLocalSyncClient::ServerFileChange ( [in] BSTR bstrFileSystemPath, [in] BSTR bstrWebPath, [in] BSTR bstrResourceID )

Parameters

Parameter

Description

bstrFileSystemPath

A string which identifies the file on the client. This value must be a non-empty local path with a maximum of 256 characters. This path must be in the directory tree specified by the FileSystemDirectoryHint when the call to Initialize was made.

bstrResourceID

A string which identifies the ResourceID of the file. This value must be non-empty with a maximum of 128 characters.

bstrWebPath

A string which identifies the file on the server. This value must be a non-empty valid URL, but no longer than INTERNET_MAX_URL_LENGTH, as defined by http://support.microsoft.com/kb/208427.

Return values

Value

Description

E_FAIL

Failure to set the cache connectivity state.

E_LSC_CONFLICTINGFILE

The file specified by bstrFileSystemPath has a different ResourceID than specified.

E_LSC_FILENOTSUPPORTED

The given file extension is not supported by the CsiSyncClient COM object. See GetSupportedFileExtensions.

E_LSC_FILENOTFOUND

The file was deleted in mid-operation.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_LOCALPATHNOTMAPPED

The given FileSystemPath is not under the directory root specified by the FileSystemDirectoryHint when the call to Initialize was made.

E_LSC_NOINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

E_LSC_PATHMISMATCH

The file specified by bstrResourceID has a different FileSystemPath than specified.

E_LSC_PENDINGCHANGESINCACHE

The specified file already has pending changes in a different cache and cannot yet be associated with the consumer's cache.

E_LSC_SERVERPATHINDIFFERENTCACHE

The WebPath provided falls under a different cache.

S_OK

The call succeeded.

ILSCLocalSyncClient::SetClientConnectivityState

Sets the cache into an online or offline state. If offline, Office will not attempt to communicate with the server for any files in that cache, regardless of each individual file's fBlockUploads setting.

HRESULT ILSCLocalSyncClient::SetClientConnectivityState ( [in] VARIANT_BOOL fIsOnline )

Parameters

fIsOnline

A boolean determining the connectivity state of the cache.

Return values

Value

Description

E_FAIL

Failure to set the cache connectivity state.

E_INVALIDARG

One or more parameters are invalid.

E_LSC_NOINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

S_OK

The call succeeded.

ILSCLocalSyncClient::SetClientNetworkSyncPermission

SetClientNetworkSyncPermission is used to either override or restoreOffice's synchronizing heuristics for network cost and power usage. When on a 3G or other high cost network, or when running on battery versus being plugged in, Office may choose to block network traffic until a more opportune time. The consumer of this API can use it to override Office's heuristics and force synchronizing to occur.

HRESULT ILSCLocalSyncClient::SetClientNetworkSyncPermission ( [in] LSCNetworkSyncPermissionType nspType, [in] VARIANT_BOOL fEnableSync )

Parameters

nspType

A flag which defines which cost heuristic to override. See Enum LSCNetworkSyncPermissionType .

fEnableSync

Specifies whether to force synchronizing on, thus overriding that cost heuristic, or to no longer override it.

Return values

Value

Description

E_FAIL

Failure to override synchronizing heuristics.

E_LSC_NOINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

S_OK

The call succeeded.

ILSCLocalSyncClient::Uninitialize

Unloads the cache from the COM object and perform closing operations. ILSCLocalSyncClient::Uninitialize MUST be called before destroying the COM object. Once called, no other APIs can be called, the COM object MUST be destroyed and a new one created if you wish to continue operations.

HRESULT ILSCLocalSyncClient::Uninitialize ( )

Parameters

None.

Return values

Value

Description

E_FAIL

Failure to uninitialize.

E_LSC_NOINITIALIZED

ILSCLocalSyncClient::Initialize has not been successfully called in the past.

S_OK

The call succeeded.

Interface IEnumLSCEvent

This interface represents a list of ILSCEvent events.

Public Member Functions

IEnumLSCEvent::FNext

Retrieves the next event from the list of events.

HRESULT IEnumLSCEvent::FNext ( [out] ILSCEvent ** ppiLSCEvent )

Parameters

ppiLSCEvent

A pointer to an ILSCEvent interface.

Return values

Value

Description

E_FAIL

There are no more events.

S_OK

The call was successful.

IEnumLSCEvent::Reset

Resets the enumerator to the first event.

HRESULT IEnumLSCEvent::Reset ( )

Parameters

None.

Return values

Always returns S_OK.

Interface ILSCEvent

This interface represents a synchronizing event. All information about the event can be retrieved from the interface.

Public Member Functions

ILSCEvent::GetConflictStatus

Note that this value is populated when ILSCLocalSyncClient::GetChanges is called, not when the event was created, so you will only have the current status of the file, not the status of the file when the conflict status changed.

This value is only populated when the Enum LSCEventType of the event is LSCEventType_OnLocalConflictStateChanged.

HRESULT ILSCEvent::GetConflictStatus ( [out] VARIANT_BOOL * pfIsInConflict )

Parameters

pfIsInConflict

The current conflict status of the file associated with the event.

Return values

Always returns S_OK.

ILSCEvent::GetError

This value is only populated when the Enum LSCEventType of the event is LSCEventType_OnServerChangesDownloaded or LSCEventType_OnLocalChangesUploaded.

HRESULT ILSCEvent::GetError ( [out] LONG * pnError )

Parameters

pnError

The error associated with this event.

Return values

Always returns S_OK.

ILSCEvent::GetETag

This value is only populated when the Enum LSCEventType of the event is LSCEventType_OnServerChangesDownloaded or LSCEventType_OnLocalChangesUploaded.

HRESULT ILSCEvent::GetETag ( [out] BSTR * pbstrETag )

Parameters

pbstrETag

The ETag associated with this event

Return values

Always returns S_OK.

ILSCEvent::GetEventType

Gets the type for this event.

HRESULT ILSCEvent::GetEventType ( [out] LSCEventType * pnEventType )

Parameters

pnEventType

The event type of this event. See Enum LSCEventType for valid values. Must not be null.

Return values

Value

Description

E_INVALIDARG

One or more parameters are invalid.

S_OK

The call was successful.

ILSCEvent::GetLocalWorkingPath

Gets the local working path for this event.

HRESULT ILSCEvent::GetLocalWorkingPath ( [out] BSTR * pbstrLocalWorkingPath )

Parameters

pbstrLocalWorkingPath

The local path of the file to which this event pertains.

Return values

Always returns S_OK.

ILSCEvent::GetResourceID

Gets the resource ID for the event.

HRESULT ILSCEvent::GetResourceID ( [out] BSTR * pbstrResourceID )

Parameters

pbstrResourceID

The ResourceID of the file associated with this event.

Return values

Always returns S_OK.

ILSCEvent::GetResourceIDAttempted

This value is only populated when the Enum LSCEventType of the event is LSCEventType_OnFilePathConflict. When a call to ILSCLocalSyncClient::LocalFileChange , ILSCLocalSyncClient::ServerFileChange , or ILSCLocalSyncClient::RenameFile would cause a Web Path or Local Path collision with another file in the Office file cache, this event is generated.

HRESULT ILSCEvent::GetResourceIDAttempted ( [out] BSTR * pbstrResourceIDAttempted )

Parameters

pbstrResourceIDAttempted

The ResourceID that caused this event to get generated. Must not be null.

Return values

Always returns S_OK.

ILSCEvent::GetSyncErrorType

This value is only populated when the Enum LSCEventType of the event is LSCEventType_OnServerChangesDownloaded or LSCEventType_OnLocalChangesUploaded.

HRESULT ILSCEvent::GetSyncErrorType ( [out] LSCEventSyncErrorType * pnSyncErrorType )

Parameters

pnSyncErrorType

The error type associated with this event. See Enum LSCEventType for potential values. Must not be null.

Return values

Value

Description

E_INVALIDARG

One or more parameters are invalid.

S_OK

The call was successful.

ILSCEvent::GetWebPath

This value is only populated when the Enum LSCEventType of the event is LSCEventType_OnFilePathConflict.

HRESULT ILSCEvent::GetWebPath ( [out] BSTR * pbstrWebPath )

Parameters

pbstrWebPath

Specifies the Web Path associated with this event. Must not be null.

Return values

Always returns S_OK.

Interface ILSCEvent2

This interface holds additional information about a synchronizing event.

Public Member Functions

ILSCEvent2::GetErrorChain

Gets the error chain information about a synchronizing event.

HRESULT ILSCEvent2::GetErrorChain ( [out] BSTR * pbstrErrorChain )

Parameters

pbstrErrorChain

A string to hold the error chain information. Must not be null.

Return values

Value

Description

E_NOTIMPL

The installed version of Office does not support this interface

E_INVALIDARG

One or more of the parameter values are invalid.

E_FAIL

The error chain information is not available.

S_OK

The call was successful.

Interface IPartnerActivityCallback

This interface provides a callback function to the CSISyncClient COM object.

Public Member Functions

IPartnerActivityCallback::EventOccurred

This is a callback function on the object given to the CsiSyncClient COM object. It's expected that when an Event occurs (see Enum LSCEventTypeOccurred for valid event types), the CsiSyncClient COM object will call this method, signalling the consumer.

HRESULT IPartnerActivityCallback::EventOccurred ( [in] LSCEventTypeOccurred eEventTypeOccurred )

Parameters

eEventTypeOccurred

The event type of this event. See Enum LSCEventTypeOccurred for valid values.

Return values

Always returns S_OK.

CSISyncClient uses the following enumerations.

Enum LSCEventSyncErrorType

This enumeration specifies the categories of errors that can occur while synchronizing a file.

Enumerator

Description

LSCEventSyncErrorType_UserInterventionRequiredUnexpected

The synchronizing error of this event was unexpected, and may require special consideration. By default, the user may have to intervene.

LSCEventSyncErrorType_NoInterventionRequired

The synchronizing error of this event does not need special consideration. Office will handle it automatically.

LSCEventSyncErrorType_UserInterventionRequired

The synchronizing error of this event requires a user to resolve it. For example, merge conflict error requires a user to open the document and merge it.

LSCEventSyncErrorType_WaitingOnClient

The synchronizing error of this event requires the consumer to intervene, but should not require special consideration by the user.

LSCEventSyncErrorType_ClientInterventionRequired

The synchronizing error of this event requires the consumer to intervene as a special case.

LSCEventSyncErrorType_Max

Enum LSCEventType

This enumeration specifies the type of events that can occur for a particular file.

Enumerator

Description

LSCEventType_None

LSCEventType_OnLocalChanges

Changes were made to a local file.

LSCEventType_OnOpenedByUser

A user opened a file.

LSCEventType_OnServerChangesDownloaded

Finished downloading file changes from the server.

LSCEventType_OnLocalChangesUploaded

Finished uploading file changes to the server.

LSCEventType_OnLocalConflictStateChanged

The merge conflict state of a file has changed.

LSCEventType_OnFileAdded

A file was added.

LSCEventType_OnFileDeleted

A file was deleted.

LSCEventType_OnSyncEnabled

Synchronizing was enabled for a user's files.

LSCEventType_OnServerChangesDownloadStarted

Started downloading file changes from the server.

LSCEventType_OnLocalChangesUploadStarted

Started uploading file changes to the server.

LSCEventType_OnFilePathConflict

This event is generated when a call to ILSCLocalSyncClient::LocalFileChange , ILSCLocalSyncClient::ServerFileChange , or ILSCLocalSyncClient::RenameFile causes a Web Path or Local Path collision with another file in the Office file cache.

LSCEventType_OnFileForked

LSCEventType_Max

Enum LSCEventTypeOccurred

This enumeration specifies the type of events that can occur. The consumer needs to call specific ILSCLocalSyncClient functions based on the event type.

Enumerator

Description

LSCEventTypeOccurred_GetChanges

An ILSCEvent has occurred. The consumer should call ILSCLocalSyncClient::GetChanges to retrieve the data.

LSCEventTypeOccurred_GetSupportedFileExtensions

The supported file extensions have changed. The consumer should call ILSCLocalSyncClient::GetSupportedFileExtensions to retrieve the new list of supported extensions.

Enum LSCNetworkSyncPermissionType

This enumeration specifies the flags used for a network cost heuristic.

Enumerator

Description

LSCNetworkSyncPermissionType_HighCost

True if the cost heuristic for expensive networks (such as 3G) is overridden.

LSCNetworkSyncPermissionType_HighPowerUsage

True if the cost heuristic for power usage (such as a battery) is overridden.

Enum LSCStatusFlag

This enumeration is used to represent the synchronize status of a file.

Enumerator

Description

LCSStatusFlag_None

LSCStatusFlag_UploadPending

True if there is pending data to send to the server file.

LSCStatusFlag_DownloadPending

True if there is pending data to download from the server file.

LSCStatusFlag_LocalFileUnchanged

True if the data Office has on the file in its cache is the most recent copy of the data on disk.

Show: