public CURLcode GetInfo(CURLINFO info, ref DateTime dt)
{
EnsureHandle();
CURLcode retCode = CURLcode.CURLE_OK;
IntPtr ptr = IntPtr.Zero;
if (info != CURLINFO.CURLINFO_FILETIME)
return CURLcode.CURLE_BAD_FUNCTION_ARGUMENT;
retCode = External.curl_easy_getinfo(m_pCURL, info, ref ptr);
if (retCode == CURLcode.CURLE_OK)
{
if ((int)ptr < 0)
dt = new DateTime(0);
else
{
int yy = 0, mm = 0, dd = 0, hh = 0, mn = 0, ss = 0;
External.curl_shim_get_file_time((int)ptr, ref yy,
ref mm, ref dd, ref hh, ref mn, ref ss);
dt = new DateTime(yy, mm, dd, hh, mn, ss);
}
}
return retCode;
}