ReactOS 0.4.16-dev-122-g325d74c
interface.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS ISA PnP Bus driver
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Driver interface
5 * COPYRIGHT: Copyright 2021 Dmitry Borisov <di.sean@protonmail.com>
6 */
7
8/* INCLUDES *******************************************************************/
9
10#include "isapnp.h"
11
12#define NDEBUG
13#include <debug.h>
14
15/* FUNCTIONS ******************************************************************/
16
17CODE_SEG("PAGE")
22{
23 PAGED_CODE();
24
26 &GUID_TRANSLATOR_INTERFACE_STANDARD))
27 {
29 CM_RESOURCE_TYPE ResourceType;
30 ULONG ParentBusType, ParentBusNumber, Dummy;
31
32 ResourceType = PtrToUlong(IrpSp->Parameters.QueryInterface.InterfaceSpecificData);
33
35 ResourceType != CmResourceTypeInterrupt)
36 {
38 }
39
40 Status = IoGetDeviceProperty(FdoExt->Pdo,
42 sizeof(ParentBusType),
43 &ParentBusType,
44 &Dummy);
45 if (!NT_SUCCESS(Status))
46 {
47 DPRINT1("BusType request failed with status 0x%08lx\n", Status);
48 return Status;
49 }
50
51 Status = IoGetDeviceProperty(FdoExt->Pdo,
53 sizeof(ParentBusNumber),
54 &ParentBusNumber,
55 &Dummy);
56 if (!NT_SUCCESS(Status))
57 {
58 DPRINT1("BusNumber request failed with status 0x%08lx\n", Status);
59 return Status;
60 }
61
62 return HalGetInterruptTranslator(ParentBusType,
63 ParentBusNumber,
64 Isa,
68 Parameters.QueryInterface.Interface,
69 &ParentBusNumber);
70 }
71
73}
#define PAGED_CODE()
#define CODE_SEG(...)
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS IsaFdoQueryInterface(_In_ PISAPNP_FDO_EXTENSION FdoExt, _In_ PIO_STACK_LOCATION IrpSp)
Definition: interface.c:19
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define PtrToUlong(u)
Definition: config.h:107
Status
Definition: gdiplustypes.h:25
@ Isa
Definition: hwresource.cpp:138
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define _In_
Definition: ms_sal.h:308
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
NTSTATUS NTAPI IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength)
Definition: pnpmgr.c:1382
struct _IO_STACK_LOCATION::@3974::@4000 QueryInterface
union _IO_STACK_LOCATION::@1575 Parameters
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
#define HalGetInterruptTranslator
Definition: haltypes.h:303
@ DevicePropertyBusNumber
Definition: iotypes.h:1209
@ DevicePropertyLegacyBusType
Definition: iotypes.h:1208