IOCTL_SCSI_GET_ADDRESS implementation

Eric Pouech eric.pouech at wanadoo.fr
Thu Apr 18 07:19:38 CDT 2002


Rizsanyi Zsolt a écrit :
> 
> Hi!
> 
> I have implemented IOCTL_SCSI_GET_ADDRESS for non scsi cdroms. On NT this
> ioctl is called on non scsi cdroms, and it should return a valid value. NT
> treats the two ide controllers as scsi (at least for this ioctl).
> The program which uses this ioctl, when the ioctl returns with success it
> tries to read further data from the registry, from the
> Machine\\HARDWARE\\DEVICEMAP\\Scsi
> 
> I have looked at the registry of my w2k and I'm trying to set up according to
> it the registry of wine.
> 
> But I have some implementation questions:
> - I'm setting up the registry in the CDROM_Open (in dlls/ntdll/cdrom.c). This
> is right, because before that no ioctl could be called, but maybe I should
> setup it when the devices are initialized (then of course only for the cdroms
> where the Device is specified in configuration), to ensure initialization
> only once, and not at every CDROM_Open
two remarks here:
- first of all, it would be better to move this at the drive
initialisation time
  in files/drive.c. However, this will be done for every process started
in a
  given session, which is not optimal (but better than each time a cdrom
is
  opened)
- another point, your code uses the Reg??? API functions to handle the
registry.
  However, to implement correctly the DLL separation, as cdrom.c 
  (and files/drive.c) reside in ntdll.dll they cannot use the Reg???
functions,
  located in advapi.dll (forwarded from kernel32.dll). You have to use
the 
  Nt???? equivalent (see dlls/ntdll/reg.c and dlls/advapi32/registry.c
for the 
  details) .

> - I'm having problems with the refreshing of the registry. If I delete the
> previously entered registry entries from system.reg, and run the (windows)
> regedit, then at start I dont have the Scsi registry key. But if I select
> ImportRegistry then the FileOpenDialog opens the cdrom, and from the debug
> messages I know that the data were entered to the registry, but regedit does
> not show it even if I press F5 (or select the Refresh menu)
> Why is this? I know that there are VOLATILE registry keys, but dont know if
> they apply here, and to how to use them...
I don't know what regedit uses (I mean does it re-read the user.dat file
- or
any equivalent -, or does it use the RegXXX functions. If the later,
this 
shouldn't happen, if both processes (regedit and the former) use the
same 
server. However, Wine uses two sets of registries: its own (normally in
~/.wine/*reg) and the optional standard & native windows file. Wine
never
rewrites the later and always update the former. All the registry
information
is stored inside the server. There is some parameter in the config file
to 
tell the server when to save the changes to the wine registry files.
What could happen is that you try to access information that has not
been saved
yet. Anyway, you'd better use the regedit from programs/regedit to get
the
current information inside the current wine session

> - I'm using some includes like linux/hdreg.h linux/major.h and sys/stat.h
> (fstat function) - where and how to add checks for them? Is it enough if I
> add those headers to the list in configure.ac?
you should add the checks in configure.ac as done for linux/cdrom.h

A+



More information about the wine-devel mailing list