I want to add "\\USB HD\" as Ftp Share Folder in Colibri T20 running Wince

Hello All,
I have an application in which ftp server need to save files in "\USB HD" rather than "\Flash Disk".
Is there any process to override ftp share folder as "\USB HD" during runtime?.
Or,
Is Ftp server source code is available for wince so that I can modify according to my application?.
and How to stop wince FTP server in wince?.

Thanks in advance.

Dear @sri406

* I looked up some documentation and the FTP server source code, but I didn’t verify the solution described here. Therefore I would appreciate a short feedback to the community whether it worked.*

Basically changing the FTP share folder requires two steps:

  1. configure the FTP server registry settings
    to represent the new configuration
  2. refresh the FTP server service
    to re-read the registry and activate the new settings

The FTP server is running as a service inside servicesd.exe. The functions you need to manipulate the FTP server are described on the Microsoft documentation page:

If you start from a running FTP server, you will need to call the following functions:

#include "service.h"
{
    DWORD bytesReturned;
    HANDLE hFtp = GetServiceHandle (L"FTP0", NULL, 0);
    BOOL fResult  = ServiceIoControl(hFtp, IOCTL_SERVICE_REFRESH, 
                                     NULL, 0 NULL, 0, &bytesReturned, NULL);
}

Here’s some direct links to the Microsoft documentation:

Regards,
Andy