ReactOS 0.4.17-dev-1196-gb6224c3
locintrf.c File Reference
#include <pci.h>
#include <debug.h>
Include dependency graph for locintrf.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI locintrf_Initializer (IN PVOID Instance)
 
static VOID NTAPI locintrf_Reference (_In_ PVOID Context)
 
static VOID NTAPI locintrf_Dereference (_In_ PVOID Context)
 
static NTSTATUS NTAPI locintrf_GetLocationString (_In_ PVOID Context, _Outptr_ PZZWSTR *LocationStrings)
 Returns "PCI(DDFF)" for a device or "PCIROOT(B)" for a root bus as a multi-sz. The caller frees the buffer.
 
NTSTATUS NTAPI locintrf_Constructor (IN PVOID DeviceExtension, IN PVOID Instance, IN PVOID InterfaceData, IN USHORT Version, IN USHORT Size, IN PINTERFACE Interface)
 

Variables

PCI_INTERFACE PciLocationInterface
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file locintrf.c.

Function Documentation

◆ locintrf_Constructor()

NTSTATUS NTAPI locintrf_Constructor ( IN PVOID  DeviceExtension,
IN PVOID  Instance,
IN PVOID  InterfaceData,
IN USHORT  Version,
IN USHORT  Size,
IN PINTERFACE  Interface 
)

Definition at line 116 of file locintrf.c.

122{
124 PAGED_CODE();
125
127 UNREFERENCED_PARAMETER(InterfaceData);
130
131 LocationInterface->Size = sizeof(*LocationInterface);
132 LocationInterface->Version = PNP_LOCATION_INTERFACE_VERSION;
133 LocationInterface->Context = DeviceExtension;
134 LocationInterface->InterfaceReference = locintrf_Reference;
135 LocationInterface->InterfaceDereference = locintrf_Dereference;
137 return STATUS_SUCCESS;
138}
#define PAGED_CODE()
static VOID NTAPI locintrf_Dereference(_In_ PVOID Context)
Definition: locintrf.c:56
static NTSTATUS NTAPI locintrf_GetLocationString(_In_ PVOID Context, _Outptr_ PZZWSTR *LocationStrings)
Returns "PCI(DDFF)" for a device or "PCIROOT(B)" for a root bus as a multi-sz. The caller frees the b...
Definition: locintrf.c:69
static VOID NTAPI locintrf_Reference(_In_ PVOID Context)
Definition: locintrf.c:46
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define STATUS_SUCCESS
Definition: shellext.h:65
PGET_LOCATION_STRING GetLocationString
Definition: iotypes.h:4559
PINTERFACE_REFERENCE InterfaceReference
Definition: iotypes.h:4557
PINTERFACE_DEREFERENCE InterfaceDereference
Definition: iotypes.h:4558
_In_ UCXUSBDEVICE _In_ ULONG Interface
Definition: ucxusbdevice.h:428
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
struct _PNP_LOCATION_INTERFACE * PPNP_LOCATION_INTERFACE
#define PNP_LOCATION_INTERFACE_VERSION
Definition: iotypes.h:5536

◆ locintrf_Dereference()

static VOID NTAPI locintrf_Dereference ( _In_ PVOID  Context)
static

Definition at line 56 of file locintrf.c.

58{
60}
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81

Referenced by locintrf_Constructor().

◆ locintrf_GetLocationString()

static NTSTATUS NTAPI locintrf_GetLocationString ( _In_ PVOID  Context,
_Outptr_ PZZWSTR *  LocationStrings 
)
static

Returns "PCI(DDFF)" for a device or "PCIROOT(B)" for a root bus as a multi-sz. The caller frees the buffer.

Definition at line 69 of file locintrf.c.

72{
75 BOOLEAN IsDevice;
79 PAGED_CODE();
80
82
83 IsDevice = (PdoExtension->ExtensionType == PciPdoExtensionType);
84 if (!IsDevice && !PCI_IS_ROOT_FDO(FdoExtension))
86
87 /* Room for the longer form plus the empty character that ends the list */
88 Size = sizeof(L"PCIROOT(FF)") + sizeof(UNICODE_NULL);
90 if (!Buffer)
92
94
95 if (IsDevice)
96 {
98 L"PCI(%02X%02X)",
99 PdoExtension->Slot.u.bits.DeviceNumber,
100 PdoExtension->Slot.u.bits.FunctionNumber);
102 }
103 else
104 {
105 /* The root starts the path, so PnP stops asking further up */
106 _swprintf(Buffer, L"PCIROOT(%X)", FdoExtension->BaseBus);
108 }
109
111 return Status;
112}
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define L(x)
Definition: resources.c:13
#define PCI_IS_ROOT_FDO(x)
Definition: pci.h:42
#define PCI_POOL_TAG
Definition: pci.h:27
@ PciPdoExtensionType
Definition: pci.h:133
@ PdoExtension
Definition: precomp.h:61
@ FdoExtension
Definition: precomp.h:60
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
Status
Definition: gdiplustypes.h:24
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
#define UNICODE_NULL
#define STATUS_TRANSLATION_COMPLETE
Definition: ntstatus.h:157
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint16_t * PWCHAR
Definition: typedefs.h:56
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Outptr_ _At_ * LocationStrings(return==0, __drv_allocatesMem(Mem))) PZZWSTR *LocationStrings

Referenced by locintrf_Constructor().

◆ locintrf_Initializer()

NTSTATUS NTAPI locintrf_Initializer ( IN PVOID  Instance)

Definition at line 35 of file locintrf.c.

36{
38 /* PnP Interfaces don't get Initialized */
39 ASSERTMSG("PCI locintrf_Initializer, unexpected call.\n", FALSE);
41}
#define FALSE
Definition: types.h:117
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

◆ locintrf_Reference()

static VOID NTAPI locintrf_Reference ( _In_ PVOID  Context)
static

Definition at line 46 of file locintrf.c.

48{
49 /* Extensions live as long as their device objects, nothing to count */
51}

Referenced by locintrf_Constructor().

Variable Documentation

◆ PciLocationInterface

PCI_INTERFACE PciLocationInterface
Initial value:
=
{
&GUID_PNP_LOCATION_INTERFACE,
0,
}
#define PCI_INTERFACE_PDO
Definition: pci.h:67
#define PCI_INTERFACE_FDO
Definition: pci.h:68
#define PCI_INTERFACE_ROOT
Definition: pci.h:69
@ PciInterface_Location
Definition: pci.h:148
NTSTATUS NTAPI locintrf_Constructor(IN PVOID DeviceExtension, IN PVOID Instance, IN PVOID InterfaceData, IN USHORT Version, IN USHORT Size, IN PINTERFACE Interface)
Definition: locintrf.c:116
NTSTATUS NTAPI locintrf_Initializer(IN PVOID Instance)
Definition: locintrf.c:35
struct _PNP_LOCATION_INTERFACE PNP_LOCATION_INTERFACE

Definition at line 18 of file locintrf.c.