/*++
*********************************************************************************
* Copyright (c) 1990-99 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 copyrighted work of Digi International		*
* Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly		*
* prohibited.																	*
* 																				*
* Restricted Rights Legend														*
*																				*
* Use, duplication, or disclosure by the Government is subject to				*
* restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in			*
* Technical Data and Computer Software clause at DFARS 252.227-7031 or			*
* subparagraphs (c)(1) and (2) of the Commercial Computer Software -			*
* Restricted Rights at 48 CFR 52.227-19, as applicable.							*
*																				*
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343			*
*																				*
*********************************************************************************

Module Name:

   digipnp.h

Abstract:

   This header contains Windows 2000 PnP/Power Utilities.  

Author:

   Mike Zarns

--*/

#ifndef _DIGIPNP_H_
#define _DIGIPNP_H_

#if NT5_BUILD

///////////////////////////////////////////////////////////////////////////
//
//	W2K Utilities
//
///////////////////////////////////////////////////////////////////////////

NTSTATUS
DigiGetDeviceInstance( 
	IN PDEVICE_OBJECT pPdo,
	IN OUT PWCHAR     buf,
	IN ULONG          cb
    );

PWCHAR
DigiGetInstanceString( 
	PWSTR pString,
	ULONG Length
	);

typedef struct DIGIPNP_MINOR_TABLE
{
	ULONG Minor;
	PCSTR Name;
} DIGIPNP_MINOR_TABLE, PDIGIPNP_MINOR_TABLE;


///////////////////////////////////////////////////////////////////////////
//
//	PnP Debug Utilities
//
///////////////////////////////////////////////////////////////////////////

#if DBG

STATIC PCSTR
DigiGetIrpName( 
	ULONG Minor,
	DIGIPNP_MINOR_TABLE const Table[],
	ULONG nEntries
	);

PCSTR 
DigiGetPnpIrpName(
	IN ULONG Minor
	);

VOID
DigiGetDeviceProperties( 
	IN PDEVICE_OBJECT pPdo
	);

#endif

///////////////////////////////////////////////////////////////////////////
//
//	PnP Irp Processing
//
///////////////////////////////////////////////////////////////////////////

NTSTATUS
DigiPnpForwardIrp( 
	IN PDEVICE_OBJECT pNextLowerDriver,
	IN PIRP           pIrp 
	);

NTSTATUS
DigiPnpForwardIrpWait( 
	IN PDEVICE_OBJECT pNextLowerDriver,
	IN PIRP           pIrp
	);

NTSTATUS
DigiPnpIrpComplete( 
	IN PDEVICE_OBJECT pDevice,
	IN PIRP           pIrp,
	IN PKEVENT        pEvent
	);


///////////////////////////////////////////////////////////////////////////
//
//	Power Debug Processing
//
///////////////////////////////////////////////////////////////////////////

#if DBG

PCSTR
DigiGetPowerIrpName(
	IN ULONG Minor
	);

PCSTR 
DigiGetPowerSystemState(
	IN ULONG Type
	);

PCSTR 
DigiGetPowerDeviceState(
	IN ULONG Type
	);

#endif

///////////////////////////////////////////////////////////////////////////
//
//	Power Processing
//
///////////////////////////////////////////////////////////////////////////

NTSTATUS
DigiPowerForwardIrp( 
	IN PDEVICE_OBJECT pDevice, 
	IN OUT PIRP       pIrp
	);

NTSTATUS
DigiPowerIrpComplete( 
	IN PDEVICE_OBJECT pDevice,
	IN PIRP           pIrp,
	IN PKEVENT        pEvent
	);

NTSTATUS
DigiPowerForwardIrpWait( 
	IN PDEVICE_OBJECT pDevice, 
	IN OUT PIRP       pIrp
	);

VOID
DigiPowerComplete( 
	IN PDEVICE_OBJECT   pDevice,
	IN UCHAR            MinorFunction,
	IN POWER_STATE      PowerState,
	IN PVOID            Context,
	IN PIO_STATUS_BLOCK IoStatus
	);

#endif

#endif /* _DIGIPNP_H_ */


