Uwe Bonnes wrote:

> Hallo,
>
> after Douglas hint on using Andi's CVS server, I found that some work
> had gone on SendASPI32Command:SC_GET_DEV_TYPE. However the application
> (ramdiag.exe coming with a HP CD Writer) still didn't show the drive
> selection. I guess that WNASPI32_DoPosting should only return
> SS_PENDING when a SRB_PostProc is available and should return the
> status else.
> Elliot: Does this fix look right?
>

Well, SendASPI32 command is supposed to queue the command immediately and
return SS_PENDING in every case (that is, there should be absolutely no error
checking or anything at this point).  Then the app either uses a PostProc or a
Mesage or polls the status byte.  Meanwhile (in another thread) the ASPI layer
is supposed to be executing the command and when it is finished it will set the
status byte then call the procedure/SetEvent.

Since we don't do background processing then we always have the command
completed before we return.  This is definitely broken, but I think a lot of
programs simply don't care.  Also, there is always the possibility under
Windows that a command could possibly be completed in the background thread
before SendASPI32Command returned, so any app that couldn't handle that
condition would be broken.

However, I can tell you right now that most apps do NOT check the return value
for SendASPI32Command, it would be a mistaken assumption to return an error and
not calll the postproc/SetEvent appropriately (which I think I fixed all those
cases and it should be in CVS).

>
> Changelog:
>  dlls/winaspi/winaspi32.c: WNASPI32_DoPosting
>         Only return SS_PENDING when a SRB_PostProc is available or
>         else the status
>
> Bye
>
> PS: Elliot, could you format you Mails with 76 letters per line?
>

Hmm.. Netscape doesn't like me or something.  I temporarily set the linewidth
to 0 to disable it and then set it back to 70.  I just set it to 76, maybe
it'll work this time.  I dunno though, right now my System is a bit screwed
(don't have any TT fonts) after doing a cpio -pmv to copy my data to the new
hard-drive.


>
> Uwe Bonnes                [EMAIL PROTECTED]
>
> Free Software: If you contribute nothing, expect nothing
> --
> Index: wine/dlls/winaspi/winaspi32.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/winaspi/winaspi32.c,v
> retrieving revision 1.3
> diff -u -r1.3 winaspi32.c
> --- wine/dlls/winaspi/winaspi32.c       2000/03/24 19:45:47     1.3
> +++ wine/dlls/winaspi/winaspi32.c       2000/03/25 20:15:12
> @@ -269,8 +269,10 @@
>                         TRACE("Setting event %04x\n", (HANDLE)SRB_PostProc);
>                         SetEvent((HANDLE)SRB_PostProc);
>                 }
> +               return SS_PENDING;
>         }
> -       return SS_PENDING;
> +       else
> +         return status;
>  }
>
>  static WORD

Actually, that looks wrong since as I said before, no program should check it
anyway, and the spec says it always returns SS_PENDING.

-Dave

Reply via email to