ICcBootStrap::Download (Windows CE 5.0)
This method starts the download of a file from the host to the device.
HRESULT Download( DWORDdwTimeout, VARIANT_BOOLbAsync, LPCOLESTRwszSrcFullPath, LPCOLESTRwszDestFullPath, VARIANT_BOOLbOverwrite, 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.This can be NULL, in which case the destination file name is same as the source file name and the file is copied to the root folder on the device.
bOverwrite
[in] Flag that indicates an overwrite if the file already exists on the device.Default is VARIANT_FALSE.
pdwCookieId
[out, retval] Cookie that identifies the method call.
Return Values
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, or that bstrSrcFullPath is an empty string. |
E_ACCESSDENIED | Indicates that the call failed because the file already exists and cannot be overwritten. |
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 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 bOverwrite are ignored.
If a client flashing a run-time image calls this method with the asynchronous flag set, the API returns immediately, and the status of the call is returned through the ICcServiceCB interface.
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
OS Version: Windows CE 5.0 and later.
Header: CcBootstrap.idl.
Link Library: none.
See Also
Send Feedback on this topic to the authors