ICcBootStrap::Download (Compact 2013)
3/26/2014
Deprecated.
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,
);
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.Passing a NULL value for this parameter will cause a NULL pointer exception.
- wszDestFullPath
[in] Destination file name including full path.
bOverwrite
[in] Flag that indicates the file already existed on the device, and was overwritten.Default is VARIANT_FALSE.
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:
|
E_INVALIDARG |
Indicates that at least one input argument is NULL. |
E_ACCESSDENIED |
Indicates that the call failed because the file already exists and cannot be overwritten. |
HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) |
A destination directory of \Release is required in this usage. |
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 |