BUG: Error Message When You Call FtpGetFile and FtpPutFile Functions: 0x00000057 - ERROR_INVALID_PARAMETER (312039)



The information in this article applies to:

  • Microsoft Windows CE Platform SDK for Pocket PC 2002

This article was previously published under Q312039

SYMPTOMS

After you successfully open a WinInet FTP connection by using the InternetOpen and InternetConnect functions, calls to the FtpGetFile and FtpPutFile functions invariably fail, and the GetLastError function returns the following error message:
0x00000057 - ERROR_INVALID_PARAMETER

RESOLUTION

To work around this issue, read and write the files manually to implement FTP file exchanges. To do this, follow these steps:
  1. Open the connection by using InternetOpen, followed by InternetConnect.
  2. Open the local file by using the CreateFile function.
  3. Open the remote file by using the FtpOpenFile function.
  4. Read the FTP or local file by using the InternetReadFile or ReadFile function, respectively.
  5. Write to FTP or a local file by using the InternetWriteFile or WriteFile function, respectively.
  6. Close the local file handle by using the CloseHandle function.
  7. Close the FTP file handle by using the InternetCloseHandle function.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Modification Type:MinorLast Reviewed:7/27/2004
Keywords:kbbug kberrmsg kbpending KB312039