1 /*
2     ReactOS Sound System
3     Sound Blaster DSP support
4     Version routine
5 
6     Author:
7         Andrew Greenwood (silverblade@reactos.org)
8 
9     History:
10         2 July 2008 - Created (split from sbdsp.c)
11 
12     Notes:
13         Functions documented in sbdsp.h
14 */
15 
16 #include "precomp.h"
17 
18 NTSTATUS
19 SbDspGetVersion(
20     IN  PUCHAR BasePort,
21     OUT PUCHAR MajorVersion,
22     OUT PUCHAR MinorVersion,
23     IN  ULONG Timeout)
24 {
25     NTSTATUS Status;
26 
27     /* Make sure our parameters are sane */
28     if ( ! MajorVersion )
29         return STATUS_INVALID_PARAMETER_2;
30 
31     if ( ! MinorVersion )
32         return STATUS_INVALID_PARAMETER_3;
33 
34     /* Send version request */
35     Status = SbDspWrite(BasePort, SB_DSP_VERSION, Timeout);
36     if ( Status != STATUS_SUCCESS )
37         return Status;
38 
39     /* Get the major version */
40     Status = SbDspRead(BasePort, MajorVersion, Timeout);
41     if ( Status != STATUS_SUCCESS )
42         return FALSE;
43 
44     /* Get the minor version */
45     Status = SbDspRead(BasePort, MinorVersion, Timeout);
46     return Status;
47 }
48