2005-07-07 23:10:35 +00:00
|
|
|
|
/*
|
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
|
* PROJECT: ReactOS Serial enumerator driver
|
|
|
|
|
* FILE: drivers/bus/serenum/serenum.h
|
|
|
|
|
* PURPOSE: Serial enumerator driver header
|
|
|
|
|
*
|
2007-07-08 22:19:51 +00:00
|
|
|
|
* PROGRAMMERS: Herv<EFBFBD> Poussineau (hpoussin@reactos.org)
|
2005-07-07 23:10:35 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2014-02-06 11:18:34 +00:00
|
|
|
|
#ifndef _SERENUM_PCH_
|
|
|
|
|
#define _SERENUM_PCH_
|
|
|
|
|
|
2005-10-06 21:39:18 +00:00
|
|
|
|
#include <ntifs.h>
|
2005-07-07 23:10:35 +00:00
|
|
|
|
#include <ntddser.h>
|
2005-04-05 19:04:07 +00:00
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
dsStopped,
|
|
|
|
|
dsStarted,
|
|
|
|
|
dsPaused,
|
|
|
|
|
dsRemoved,
|
|
|
|
|
dsSurpriseRemoved
|
|
|
|
|
} SERENUM_DEVICE_STATE;
|
|
|
|
|
|
|
|
|
|
typedef struct _COMMON_DEVICE_EXTENSION
|
|
|
|
|
{
|
|
|
|
|
BOOLEAN IsFDO;
|
|
|
|
|
SERENUM_DEVICE_STATE PnpState;
|
|
|
|
|
} COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
|
|
|
|
|
|
|
|
|
|
typedef struct _FDO_DEVICE_EXTENSION
|
|
|
|
|
{
|
|
|
|
|
COMMON_DEVICE_EXTENSION Common;
|
2005-05-08 02:16:32 +00:00
|
|
|
|
|
2005-04-05 19:04:07 +00:00
|
|
|
|
PDEVICE_OBJECT LowerDevice;
|
|
|
|
|
PDEVICE_OBJECT Pdo;
|
|
|
|
|
IO_REMOVE_LOCK RemoveLock;
|
2005-05-08 02:16:32 +00:00
|
|
|
|
|
2005-04-30 15:04:10 +00:00
|
|
|
|
UNICODE_STRING SerenumInterfaceName;
|
2005-05-08 02:16:32 +00:00
|
|
|
|
|
2005-04-05 19:04:07 +00:00
|
|
|
|
PDEVICE_OBJECT AttachedPdo;
|
|
|
|
|
ULONG Flags;
|
|
|
|
|
} FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
|
|
|
|
|
|
|
|
|
|
typedef struct _PDO_DEVICE_EXTENSION
|
|
|
|
|
{
|
|
|
|
|
COMMON_DEVICE_EXTENSION Common;
|
2005-05-08 02:16:32 +00:00
|
|
|
|
|
2005-04-05 19:04:07 +00:00
|
|
|
|
PDEVICE_OBJECT AttachedFdo;
|
2005-05-08 02:16:32 +00:00
|
|
|
|
|
2005-04-05 19:04:07 +00:00
|
|
|
|
UNICODE_STRING DeviceDescription; // REG_SZ
|
|
|
|
|
UNICODE_STRING DeviceId; // REG_SZ
|
2005-06-13 21:51:42 +00:00
|
|
|
|
UNICODE_STRING InstanceId; // REG_SZ
|
2005-04-05 19:04:07 +00:00
|
|
|
|
UNICODE_STRING HardwareIds; // REG_MULTI_SZ
|
|
|
|
|
UNICODE_STRING CompatibleIds; // REG_MULTI_SZ
|
|
|
|
|
} PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
|
|
|
|
|
|
2009-08-24 17:12:25 +00:00
|
|
|
|
#define SERENUM_TAG 'ereS'
|
2005-04-05 19:04:07 +00:00
|
|
|
|
|
|
|
|
|
/* Flags */
|
|
|
|
|
#define FLAG_ENUMERATION_DONE 0x01
|
|
|
|
|
|
|
|
|
|
/************************************ detect.c */
|
|
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
|
SerenumDetectPnpDevice(
|
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
|
IN PDEVICE_OBJECT LowerDevice);
|
|
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
|
SerenumDetectLegacyDevice(
|
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
|
IN PDEVICE_OBJECT LowerDevice);
|
|
|
|
|
|
|
|
|
|
/************************************ fdo.c */
|
|
|
|
|
|
2007-03-28 18:47:35 +00:00
|
|
|
|
DRIVER_ADD_DEVICE SerenumAddDevice;
|
2005-04-05 19:04:07 +00:00
|
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
|
SerenumFdoPnp(
|
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
|
|
/************************************ misc.c */
|
|
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
|
SerenumInitMultiSzString(
|
|
|
|
|
OUT PUNICODE_STRING Destination,
|
2005-04-30 15:04:10 +00:00
|
|
|
|
... /* list of PCSZ */);
|
2005-04-05 19:04:07 +00:00
|
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
|
ForwardIrpAndWait(
|
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
2006-06-07 17:31:43 +00:00
|
|
|
|
NTSTATUS NTAPI
|
2005-04-05 19:04:07 +00:00
|
|
|
|
ForwardIrpToLowerDeviceAndForget(
|
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
2006-06-07 17:31:43 +00:00
|
|
|
|
NTSTATUS NTAPI
|
2005-04-05 19:04:07 +00:00
|
|
|
|
ForwardIrpToAttachedFdoAndForget(
|
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
2006-06-07 17:31:43 +00:00
|
|
|
|
NTSTATUS NTAPI
|
2005-04-05 19:04:07 +00:00
|
|
|
|
ForwardIrpAndForget(
|
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
2007-03-28 18:47:35 +00:00
|
|
|
|
NTSTATUS
|
|
|
|
|
DuplicateUnicodeString(
|
|
|
|
|
IN ULONG Flags,
|
|
|
|
|
IN PCUNICODE_STRING SourceString,
|
|
|
|
|
OUT PUNICODE_STRING DestinationString);
|
|
|
|
|
|
2005-04-05 19:04:07 +00:00
|
|
|
|
/************************************ pdo.c */
|
|
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
|
SerenumPdoPnp(
|
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
|
IN PIRP Irp);
|
2005-10-06 21:39:18 +00:00
|
|
|
|
|
|
|
|
|
/************************************ serenum.c */
|
|
|
|
|
|
2006-06-07 17:31:43 +00:00
|
|
|
|
NTSTATUS NTAPI
|
2005-10-06 21:39:18 +00:00
|
|
|
|
DriverEntry(
|
|
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
|
IN PUNICODE_STRING RegPath);
|
2014-02-06 11:18:34 +00:00
|
|
|
|
|
|
|
|
|
#endif /* _SERENUM_PCH_ */
|