Here's a snippet from Brian Kelley's article from yesterday, "SQL Server Auditing - Part 1".
DECLARE @AuditLevel int
EXEC master..xp_regread
@rootkey='HKEY_LOCAL_MACHINE',
@key='SOFTWARE\Microsoft\MSSQLServer\MSSQLServer',
@value_name='AuditLevel',
@value=@AuditLevel OUTPUT
SELECT @AuditLevel
Brian is talking about retrieving the audit level, but you could use the same code for your purposes.
Steve