mirror of
https://github.com/reactos/reactos.git
synced 2024-11-01 04:11:30 +00:00
132 lines
2.6 KiB
C
132 lines
2.6 KiB
C
/*
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS Serial enumerator driver
|
|
* FILE: drivers/bus/serenum/serenum.h
|
|
* PURPOSE: Serial enumerator driver header
|
|
*
|
|
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
|
*/
|
|
|
|
#ifndef _SERENUM_PCH_
|
|
#define _SERENUM_PCH_
|
|
|
|
#include <ntifs.h>
|
|
#include <ntddser.h>
|
|
|
|
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;
|
|
|
|
PDEVICE_OBJECT LowerDevice;
|
|
PDEVICE_OBJECT Pdo;
|
|
IO_REMOVE_LOCK RemoveLock;
|
|
|
|
UNICODE_STRING SerenumInterfaceName;
|
|
|
|
PDEVICE_OBJECT AttachedPdo;
|
|
ULONG Flags;
|
|
} FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
|
|
|
|
typedef struct _PDO_DEVICE_EXTENSION
|
|
{
|
|
COMMON_DEVICE_EXTENSION Common;
|
|
|
|
PDEVICE_OBJECT AttachedFdo;
|
|
|
|
UNICODE_STRING DeviceDescription; // REG_SZ
|
|
UNICODE_STRING DeviceId; // REG_SZ
|
|
UNICODE_STRING InstanceId; // REG_SZ
|
|
UNICODE_STRING HardwareIds; // REG_MULTI_SZ
|
|
UNICODE_STRING CompatibleIds; // REG_MULTI_SZ
|
|
} PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
|
|
|
|
#define SERENUM_TAG 'ereS'
|
|
|
|
/* 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 */
|
|
|
|
DRIVER_ADD_DEVICE SerenumAddDevice;
|
|
|
|
NTSTATUS
|
|
SerenumFdoPnp(
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
IN PIRP Irp);
|
|
|
|
/************************************ misc.c */
|
|
|
|
NTSTATUS
|
|
SerenumInitMultiSzString(
|
|
OUT PUNICODE_STRING Destination,
|
|
... /* list of PCSZ */);
|
|
|
|
NTSTATUS
|
|
ForwardIrpAndWait(
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
IN PIRP Irp);
|
|
|
|
NTSTATUS NTAPI
|
|
ForwardIrpToLowerDeviceAndForget(
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
IN PIRP Irp);
|
|
|
|
NTSTATUS NTAPI
|
|
ForwardIrpToAttachedFdoAndForget(
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
IN PIRP Irp);
|
|
|
|
NTSTATUS NTAPI
|
|
ForwardIrpAndForget(
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
IN PIRP Irp);
|
|
|
|
NTSTATUS
|
|
DuplicateUnicodeString(
|
|
IN ULONG Flags,
|
|
IN PCUNICODE_STRING SourceString,
|
|
OUT PUNICODE_STRING DestinationString);
|
|
|
|
/************************************ pdo.c */
|
|
|
|
NTSTATUS
|
|
SerenumPdoPnp(
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
IN PIRP Irp);
|
|
|
|
/************************************ serenum.c */
|
|
|
|
NTSTATUS NTAPI
|
|
DriverEntry(
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
IN PUNICODE_STRING RegPath);
|
|
|
|
#endif /* _SERENUM_PCH_ */
|