Share via


ICcBootStrap::Download (Windows Embedded CE 6.0)

1/5/2010

This method starts the download of a file from the host to the device. The method copies the source file to the flat release directory.

Syntax

HRESULT Download(
  DWORD dwTimeout,
  VARIANT_BOOL bAsync,
  LPCOLESTR wszSrcFullPath,
  LPCOLESTR wszDestFullPath,
  VARIANT_BOOL bOverwrite,
  DWORD* pdwCookieId
);

Parameters

  • dwTimeout
    [in] Timeout (in milliseconds) to wait for download to start.
  • bAsync
    [in] Use asynchronous call.

    If this is set to the default, VARIANT_TRUE, the method returns immediately and the client gets status on the download progress through the callback function.

  • wszSrcFullPath
    [in] Source file name including full path.
  • wszDestFullPath
    [in] Destination file name including full path.

    For application bootstrap, this value must be "\Release". For any directory other than \Release, the function returns HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND).

    If the function is unable to copy the source directory to \Release, the function adds the source directory to a list of alternate flat release directories.

  • bOverwrite
    [in] Flag that indicates the file already existed on the device, and was overwritten.

    Default is VARIANT_FALSE.

  • pdwCookieId
    [out, retval] Cookie that identifies the method call.

Return Value

The following table shows possible return values from this method.

Value Description

S_OK

Indicates the method call was successful.

S_FALSE

Indicates that the file was not copied to the device because both of the following are true:

  • A file by the same name exists on the device
  • The bOverwrite parameter is set to VARIANT_FALSE

E_INVALIDARG

Indicates that at least one input argument is NULL, or that bstrSrcFullPath is an empty string.

E_ACCESSDENIED

Indicates that the call failed because the file already exists and cannot be overwritten.

HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)

Returns when a destination directory other than \Release is provided for application download.

E_PENDING

Indicates that the download could not be started within the given timeout.

Users can try again with the same or a different timeout value.

E_FAIL

Indicates any other failure.

In addition, if CreateFile or ReadFile fails on the target device, this method can return an HRESULT error code.

Remarks

You can use this method to flash a run-time image to a device, or to download a single application file to a device.

For a run-time image flash, wszDestFullPath and bOverwriteare ignored. If a client sets asynchronous flag when calling this method to flash a run-time image, the API returns immediately, and the ICcServiceCB interface returns the status of the call.

For application bootstrapping, the method copies the source file to the flat release directory, using the file name designated in wszDestFullPath. For application bootstrap, wszDestFullPath must start with \Release.

This method does not support asynchronous file download for application bootstrapping. If a client bootstraps an application, bAsync and pdwCookieId are ignored. If a client calls this method with bAsync set to VARIANT_TRUE for application bootstraps, the API returns E_NOTIMPL.

Requirements

Header ccbootstrap.idl
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

ICcBootstrap
Core Connectivity Interfaces