Hi Ged,
I do some little tests and I think I find the problem for now.
For example, if I want to scan 'D:\test' and pass the char into it. The code 
will translate it to wchar and it becames '\\?\D:\test'. It will open the same 
folder if you put them in folder's address bar. But _wopen will return -1 if 
you use '\\?\D:\test'.
________________________________
发件人: clamav-users <[email protected]> 代表 G.W. Haywood via 
clamav-users <[email protected]>
发送时间: 2020年9月9日 7:26
收件人: Gao Hui via clamav-users <[email protected]>
抄送: G.W. Haywood <[email protected]>
主题: Re: [clamav-users] 回复: Cannot get 'fd' when using API 'cl_scanfile'

Hi there,

On Wed, 9 Sep 2020, Gao Hui via clamav-users wrote:

> I am trying to use API to scan a file with the file's absolute file
> path under Windows system.
> ...
> I use the GetLastError and get error code 5. But I still don't
> understand it why I don't have the authotity. Even I can't open a
> file in D:\\ disk.  Btw, I write golang and call libclamav to scan
> the file. Is there any thing I need to pay attention?

I don't really do Windows, so even if you'd told us which versions of
everything you are using it wouldn't have helped me.  But I do have
some experience of fixing things.

In a case like this I'd probably look for something which uses the API
calls to the library successfully, and run that through the same debug
processes which you are using for the code which fails.  Comparing the
code which succeeds with the code which fails should shed some light.

You probably have something which succeeds in the ClamAV distribution.

--

73,
Ged.

_______________________________________________

clamav-users mailing list
[email protected]
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
_______________________________________________

clamav-users mailing list
[email protected]
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml

Reply via email to