[PATCH 1/4] msvcp110: Add tr2_sys__File_size implementation and test.(try 3)
Piotr Caban
piotr.caban at gmail.com
Thu Jun 11 03:21:02 CDT 2015
Hi,
On 06/11/15 09:02, YongHao Hu wrote:
> Do you mean that I should not test GetLastError in msvcp?
The _Equivalent tests shows that applications probably shouldn't depend
on GetLastError value. The function sometimes sets error even if it
succeeds, sometimes the error depends on arguments order. In general
while using msvcp/msvcrt functions applications are supposed to check
errno value that is not set in this case.
The tests shows that Microsoft is probably using different functions
internally. E.g. this code looks suspicious:
+ULONGLONG __cdecl tr2_sys__File_size(const char* path)
+{
+ WIN32_FILE_ATTRIBUTE_DATA fad;
+
+ TRACE("(%p)\n", path);
+ if(!path) {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
I don't think msvcp should set the error explicitly. It's why I think
it's better to just skip GetLastError tests and revisit it if we find
any application that depends on GetLastError value. I don't think we
will find any.
> I am afraid it is necessary to test it because the implementation may
> change it and I found some issues about error handling in kernel32
> functions like RemoveDirectoryA and CopyFileA etc.
The tests should go to kernel32/tests in this case.
Thanks,
Piotr
More information about the wine-devel
mailing list