<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 1/1/11 4:07 AM, maury lo&iuml;c wrote:
    <blockquote
      cite="mid:AANLkTi=2MF__QDY1N_h17swDcBijwtxHV2sGxhf1+3uJ@mail.gmail.com"
      type="cite">On Sat, Jan 1, 2011 at 2:22 AM, James McKenzie <span
        dir="ltr">&lt;<a moz-do-not-send="true"
          href="mailto:jjmckenzie51@earthlink.net">jjmckenzie51@earthlink.net</a>&gt;</span>
      wrote:<br>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div class="im">On 12/31/10 1:50 PM, Charles Davis wrote:<br>
            <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              On 12/31/10 1:11 PM, Ken Thomases wrote:<br>
              <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
                0.8ex; border-left: 1px solid rgb(204, 204, 204);
                padding-left: 1ex;">
                I should add that this patch seem correct to me. &nbsp;It
                couldn't hurt to get Charles Davis's input, of course.<br>
              </blockquote>
              I agree, for now. He should at least put a comment in to
              the effect of<br>
              "if we got this far, there's already media in the drive."<br>
            </blockquote>
          </div>
          That was the point I was trying to get to. &nbsp;Based on Ken's
          comment below, the device is temporary and only exists for the
          time period that the device is in use.
          <div class="im"><br>
            <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
                0.8ex; border-left: 1px solid rgb(204, 204, 204);
                padding-left: 1ex;">
                MSDN documents that the purpose of IOCTL_*_CHECK_VERIFY
                is to check if the media has changed. &nbsp;The Linux and
                FreeBSD implementations basically just check if there's
                media in the drive. &nbsp;On Mac OS X, the BSD device file
                just plain doesn't exist unless and until there's media
                mounted. &nbsp;There's no permanent BSD device file for the
                drive itself. &nbsp;So, if CDROM_Verify() is called, which
                requires that the BSD device file is opened and thus is
                present, that by itself implies that there's media in
                the drive. &nbsp;Therefore, CDROM_Verify() should just return
                success.<br>
              </blockquote>
              Makes sense. But the 'right' way to implement this on Mac
              OS is to ask<br>
              DiskArbitration to tell us when the media changes. (In
              fact, the right<br>
              way to implement this elsewhere is to ask udev or hald the
              same thing.)<br>
              Then we can return STATUS_VERIFY_REQUIRED (as documented)
              when the media<br>
              actually has changed. For now, though, Lo&iuml;c's patch is OK.<br>
            </blockquote>
          </div>
          Is this going to be changed sometime in the future to work per
          the documentation?
          <div class="im"><br>
            <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              AJ wants to eventually move some (all?) of the
              disk/CD/DVD/storage<br>
              IOCTLs into mountmgr anyway, where Wine's fake storage
              drivers are<br>
              hosted. Mountmgr already has infrastructure in place to
              talk to DA on<br>
              Mac OS and to hald on Linux/FreeBSD, so doing this the
              'right' way will<br>
              be much easier there.<br>
            </blockquote>
          </div>
          This is a good point. &nbsp;Maybe the effort should be to move the
          code over to mountmgr.sys rather than implement and have to
          move it later.<br>
          <br>
          And I am aware what the process is, I was asking general
          questions based on what the comments were in the patch.
          &nbsp;Basically, the comments did not make sense to me and I was
          asking for clarification. &nbsp;That was provided by both Ken and
          Charles' comments.<br>
          <font color="#888888">
            <br>
            James McKenzie<br>
            <br>
            <br>
            <br>
          </font></blockquote>
      </div>
      <br>
      <div>Hello Mr.McKenzie and Wine community,
        <div><br>
        </div>
        <div>Happy new years.</div>
        <div><br>
        </div>
        <div>In fact, I don't try to resolve the SCSI command ioctl, to
          support the cd-rom,</div>
        <div>I have just modified the CDROM_Verify(), because I thought,
          this function</div>
        <div>verify if the media is present in the device.</div>
        <div><br>
        </div>
        <div>Here my reasoning :</div>
        <div><br>
        </div>
        <div>in dll/ntdll/cdrom.c, we are in the function
          CDROM_DeviceIoControl().</div>
        <div><br>
        </div>
        <div>get_parent_device() is called to get the device and&nbsp;Wine
          try to open the device.</div>
        <div><br>
        </div>
        <div>For what I understood, &nbsp;Mac Os will create an entry object
          into the I/O Registry,</div>
        <div>who represent our device,&nbsp;(the device exist at boot time or
          when it is plugged).</div>
        <div><br>
        </div>
        <div>get_parent_device() will find the object, and store the
          name of device.</div>
        <div><br>
        </div>
        <div>After the device is found, Wine try to open it.</div>
        <div><br>
        </div>
        <div><span class="Apple-style-span" style="font-family:
            arial,sans-serif; border-collapse: collapse;">In the case of
            IOCTL_*_CHECK_VERIFY request, CDROM_Verify is called, In
            this function, we already know we have a valid device,</span></div>
        <div><span class="Apple-style-span" style="font-family:
            arial,sans-serif; border-collapse: collapse;">in use, but if
            the device is present, the media is present too, we can not
            have a file descriptor to a device, without</span></div>
        <div><span class="Apple-style-span" style="font-family:
            arial,sans-serif; border-collapse: collapse;">media present.</span></div>
        <div><span class="Apple-style-span" style="font-family:
            arial,sans-serif; border-collapse: collapse;"><br>
          </span></div>
        <br>
      </div>
    </blockquote>
    Thank you for the explanation of why you did it this way.&nbsp; This does
    work.&nbsp; MacOSX has to be different in how it does this and that makes
    things difficult for Mac users and developers (when you step outside
    the 'box' that Apple defined for us.)<br>
    <br>
    James McKenzie<br>
    <br>
  </body>
</html>