[En-Nut-Discussion] Get file size vomVIRTUALDEVICE
Oliver Schulz
olischulz at web.de
Sun Jul 25 16:57:15 CEST 2004
Hi Harald,
>
> Not really. The problem is, that it will not be backward
> compatible. The code needs to distinguish between version
> <= 3.4 and >= 3.5.
Well right. Perhaps this is a good point for version 4.x. But then I would
suggest to use a kind of simple data type for all these file and device
handling stuff. In Win32k the CreateFile function returns a 'HANDLE',
independent of the kind of the opened file (even if its a device). So the
user doesn't need to care whether he is working with NUTFILE, NUTDEVICE or
VIRTUALDEVICE...
>
> Fortunately ioctl() may able to tell, wether the first
> parameter points to a device or file. nf_next isn't
> used yet, so we can redefine it as a magic and set it
> to a value, that can't be a pointer. dev_next will
> always contain a real pointer, including the NULL pointer.
Good idea. I think that can be the next approach, but need some time to
think about it...
BTW, replacing the first parameter of ioctl from NUTDEVICE to NUTFILE cannot
work, because we have some situations (mainly in dev_init), where we don't
have a valid NUTFILE, but just the NUTDEVICE. If ioctl is called in
dev_init, we only can use the NUTDEVICE. Surely, we can create a dummy
NUTFILE with nf_dev member correctly initialized, but that becomes more and
more ugly.
So long,
Oliver.
More information about the En-Nut-Discussion
mailing list