/*++

*******************************************************************************
* Copyright (c) 1994-95 Digi International Inc., All Rights Reserved          *
*                                                                             *
* This  software  contains  proprietary  and  confidential   information   of *
* Digi International  Inc.   By  accepting  transfer  of this copy, Recipient *
* agrees to retain this software in  confidence,  to  prevent  disclosure  to *
* others,  and  to make no  use of this software other than that for which it *
* was delivered.  This is an unpublished copyright work  Digi   International *
* Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is *
* strictly prohibited.                                                        *
*                                                                             *
* Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc. *
* Confidential  when   combined   with   the   aggregated  modules  for  this *
* product) OBJECT CODE ONLY SOURCE MATERIALS                                  *
*                                                                             *
* (C) COPYRIGHT Digi International Inc. 1994-95                               *
*                                                                             *
* All Rights Reserved                                                         *
*                                                                             *
* US   Government   Users   Restricted   Rights   -   Use,   duplication   or *
* disclosure  restricted by GSA ADP Schedule Contract with Digi International *
* Inc.                                                                        *
*                                                                             *
*******************************************************************************

Module Name:

   debug.c

Abstract:

   This module defines debug routines.

Author:

   Michael Zarns

--*/

#include <ntddk.h>
#include "digilib.h"
#include "debug.h"


#if DBG

NTSTATUS
DebugGetRegParams(
	IN PUNICODE_STRING pRegistryPath,
	OUT PBOOLEAN pbBreakOnEntry )
{
	NTSTATUS Status;
	ULONG ShouldBreak = FALSE;
	HANDLE hKey;

	Status = DigiRegOpenKey( &hKey, pRegistryPath->Buffer );
	if ( NT_SUCCESS( Status ) )
	{
		DigiRegQueryDword( hKey, L"DebugBreak", &ShouldBreak, DigiRegFlagOptional, 0 );
		DigiRegQueryDword( hKey, L"DebugMode", &gDebugMode, DigiRegFlagOptional, DEBUGMODE_CONSOLE );
		DigiRegQueryDword( hKey, L"DebugMask", &gDebugMask, DigiRegFlagOptional, DIGIERRORS|DIGIINIT|DIGITHROUGHPUT );
		DigiRegCloseKey( hKey );
	}

	*pbBreakOnEntry = (BOOLEAN) ShouldBreak;
	
	return( Status );
}

#endif