Even better emulate POSIX file functions (reduced)

This is reduced version of #5694.
Only obvious fixes.
Dont make it so complicated.

IF(len ==0) {
Char buf;
Read(&buf, 0);
}

If file system writes it is broken and needs to be fixed.
On Nov 13, 2014 1:53 AM, "Karlson2k" <notifications@github.com> wrote:

> In xbmc/filesystem/win32/Win32File.cpp:
>
> > @@ -227,6 +241,18 @@ ssize_t CWin32File::Write(const void* lpBuf, size_t uiBufSize)
> >      return -1;
> >    }
> >
> > +  if (uiBufSize == 0)
> > +  { // allow "test" write with zero size
> > +    XUTILS::auto_buffer dummyBuf(255);
> > +    dummyBuf.get()[0] = 0;
> > +    DWORD bytesWritten = 0;
> > +    if (!WriteFile(m_hFile, dummyBuf.get(), 0, &bytesWritten, NULL))
> > +      return -1;
> > +
> > +    assert(bytesWritten != 0);
> > +    return 0;
> > +  }
>
> Without this patch,this function always return 0 for zero buffer size,
> without real trying to read. Win32File (as well as PosixFile) is used
> directly in code, without CFile layer so it's good idea to support any
> possible parameter values.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/xbmc/xbmc/pull/5707/files#r20265618>.
>