ReactOS  0.4.15-dev-3308-g9455def
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 
17 CODE_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  {
37  return STATUS_NOT_SUPPORTED;
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 
72  return STATUS_NOT_SUPPORTED;
73 }
return STATUS_NOT_SUPPORTED
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
LONG NTSTATUS
Definition: precomp.h:26
#define HalGetInterruptTranslator
Definition: haltypes.h:292
struct _IO_STACK_LOCATION::@3729::@3755 QueryInterface
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:240
#define _In_
Definition: ms_sal.h:308
NTSTATUS NTAPI IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength)
Definition: pnpmgr.c:1952
#define PtrToUlong(u)
Definition: config.h:107
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define DPRINT1
Definition: precomp.h:8
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
NTSTATUS IsaFdoQueryInterface(_In_ PISAPNP_FDO_EXTENSION FdoExt, _In_ PIO_STACK_LOCATION IrpSp)
Definition: interface.c:19
unsigned int ULONG
Definition: retypes.h:1
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
#define PAGED_CODE()