LIBCURL.DLL FTP 客户端

int  CEVDownLoadDlg::FtpUploadFile(CURL * curl,char *pUrl, unsigned short usPort,FILE * fpUploadFile, int nUploadFileSize)
{
    ASSERT(curl != NULL);
    curl_easy_reset(curl);
    curl_easy_setopt(curl, CURLOPT_HEADER, 0); 
    char szCurlUrl[128] = { 0 };
    sprintf(szCurlUrl, "%s", pUrl);
    curl_easy_setopt(curl, CURLOPT_URL, szCurlUrl);
    curl_easy_setopt(curl, CURLOPT_PORT, 21);
    /*user & pwd*/
    std::string NameAndKey = "root:000111";
    curl_easy_setopt(curl, CURLOPT_USERPWD, NameAndKey.c_str());

    FILE *ptempfile = fopen("E:\\DTools_Debug\\Projects\\1001.txt", "rb");
    long nsize;
    if (ptempfile!=NULL)
    {
        fseek(ptempfile,0,SEEK_END);
        nsize = ftell(ptempfile);
        fseek(ptempfile,0,SEEK_SET);
    }
    curl_easy_setopt(curl, CURLOPT_READDATA, ptempfile);
    curl_easy_setopt(curl, CURLOPT_READFUNCTION,FtpReadFunction);
    curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
    curl_easy_setopt(curl, CURLOPT_INFILESIZE, nsize);
//  curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS, 1);
    curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5);
    curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5);
    CURLcode res = curl_easy_perform(curl);
    /* Check for errors */
    if (res != CURLE_OK)
    {
        return 1;
    }
    return 0;
}

size_t CEVDownLoadDlg::FtpReadFunction(void *ptr, size_t size, size_t nmemb, void *stream)
{
    if (stream == NULL || ptr == NULL || size == 0)
        return 0;

    FILE* pfile = (FILE*)stream;
    size_t retcode=fread(ptr,size,nmemb,pfile);//read
    return retcode;
}

求大佬分析一下
问题1:FtpReadFunction中 nmenber 大小怎么设置 curl_easy_setopt(curl, CURLOPT_INFILESIZE, nsize);好像没有影响
问题2:CURLcode res = curl_easy_perform(curl); 报错(LIBCURL.DLL): 0xC0000005: Access Violation. (汇编 mov dword ptr [eax],esi) 其中eax=0;

https://blog.csdn.net/u012234115/article/details/83869486