[MPlayer-dev-eng] [PATCH] VCD support for Windows (except Win9x)

Zuxy Meng zuxy.meng at gmail.com
Sat Mar 10 07:21:48 CET 2007


Hi,

2007/3/9, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Wed, Feb 28, 2007 at 04:10:15PM +0800, Zuxy Meng wrote:
> > +#ifdef WIN32
> > +  device[4] = p->device[0];
> > +  hd = CreateFile(device, GENERIC_READ, FILE_SHARE_READ, NULL,
> > +       OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
> > +  /* It's safe here: when f gets close()'ed, hd will be released too. */
> > +  f = _open_osfhandle((long)hd, _O_RDONLY);
>
> Not really important, but I don't quite understand what the comment is
> supposed to mean. A comment why CreateFile is needed and a "normal" open
> does not work might be interesting, too.

What about:

open() on Windows can't get a file descriptor to a device so we have
to use CreateFile to get a handle first and convert it to a fd.


-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6



More information about the MPlayer-dev-eng mailing list