http://bugs.winehq.org/show_bug.cgi?id=34719
Bug #: 34719 Summary: cabinet_open{,_stream} returns 0 on failure but doesn't compliant to _open interface Product: Wine Version: 1.7.4 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: msi AssignedTo: wine-bugs@winehq.org ReportedBy: flast@flast.jp Classification: Unclassified
cabinet_open{,_stream} function returns 0 on failure, which function passed to FDICreate. Then, comments of FDICreate(in dlls/cabinet/fdi.c) says requirement of callbacks. I quote the comment about open callback: <quote> * pfnopen [I] A pointer to a function which opens a file. Uses * the same interface as _open. </quote>
And MSDN documentation describes about _open, what should be compliant to. http://msdn.microsoft.com/en-us/library/z0kc8e3z(v=vs.110).aspx
I also quote the Return Value section. <quote> Each of these functions returns a file descriptor for the opened file. A return value of -1 indicates an error, in which case errno is set to one of the following values. </quote>
Therefore, cabinet_open{,_stream} should return -1 on failure. I attached a my candidate patch, please check it.
Thanks,