ReactOS 0.4.17-dev-1133-gc25e4fd
pnpprop.c File Reference
#include <ntoskrnl.h>
#include <devpkey.h>
#include <debug.h>
Include dependency graph for pnpprop.c:

Go to the source code of this file.

Classes

struct  _PIP_PROP_OBJECT
 
struct  _PIP_PROP_NAME
 
struct  _PIP_BUILTIN_PROPERTY
 
struct  _PIP_PROP_TYPE_RULE
 
struct  _PIP_PROP_SAVED_VALUE
 
struct  _PIP_PROP_OUTPUT
 

Macros

#define NDEBUG
 
#define TAG_PNP_PROPERTY   'rPpP'
 
#define PIP_PROP_REG_TYPE_MARK   0xFFFF0000UL
 
#define PIP_PROP_FMTID_CHARS   (38 + 1)
 
#define PIP_PROP_PID_CHARS   (8 + 1)
 
#define PIP_PROP_PATH_CHARS   (10 + 1 + 38 + 1 + 8 + 1)
 
#define PIP_PROP_MAX_QUERY_SIZE   0x10000
 
#define PIP_PROP_READ_ONLY   0x00000001
 
#define PIP_PROP_ROOT_ENUM_WRITE   0x00000002
 
#define PIP_PROP_OBJECT_PROTECTED   0x00000001
 

Typedefs

typedef enum _PIP_PROP_OBJECT_KIND PIP_PROP_OBJECT_KIND
 
typedef struct _PIP_PROP_OBJECT PIP_PROP_OBJECT
 
typedef struct _PIP_PROP_OBJECT * PPIP_PROP_OBJECT
 
typedef struct _PIP_PROP_NAME PIP_PROP_NAME
 
typedef struct _PIP_PROP_NAME * PPIP_PROP_NAME
 
typedef enum _PIP_PROP_SOURCE PIP_PROP_SOURCE
 
typedef enum _PIP_PROP_FIELD PIP_PROP_FIELD
 
typedef struct _PIP_BUILTIN_PROPERTY PIP_BUILTIN_PROPERTY
 
typedef struct _PIP_BUILTIN_PROPERTY * PPIP_BUILTIN_PROPERTY
 
typedef enum _PIP_PROP_CHECK PIP_PROP_CHECK
 
typedef struct _PIP_PROP_TYPE_RULE PIP_PROP_TYPE_RULE
 
typedef struct _PIP_PROP_SAVED_VALUE PIP_PROP_SAVED_VALUE
 
typedef struct _PIP_PROP_SAVED_VALUE * PPIP_PROP_SAVED_VALUE
 
typedef struct _PIP_PROP_OUTPUT PIP_PROP_OUTPUT
 
typedef struct _PIP_PROP_OUTPUT * PPIP_PROP_OUTPUT
 
typedef BOOLEAN(* PIP_PROP_READER) (_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Inout_ PPIP_PROP_OUTPUT Out, _Out_ PNTSTATUS Status)
 
typedef enum _PIP_PROP_TARGET PIP_PROP_TARGET
 

Enumerations

enum  _PIP_PROP_OBJECT_KIND { PipPropObjectDevice , PipPropObjectInterface }
 
enum  _PIP_PROP_SOURCE { PipSourceKeyValue , PipSourceRegistryProperty , PipSourceDeviceNode , PipSourceInterface }
 
enum  _PIP_PROP_FIELD {
  PipFieldName , PipFieldInstanceId , PipFieldParent , PipFieldStatus ,
  PipFieldProblemCode , PipFieldHasProblem , PipFieldIsPresent , PipFieldInterfaceClass ,
  PipFieldInterfaceEnabled , PipFieldInterfaceDevice , PipFieldInterfaceReference
}
 
enum  _PIP_PROP_CHECK {
  PipCheckNone , PipCheckNoData , PipCheckBoolean , PipCheckFileTime ,
  PipCheckString , PipCheckSecurity
}
 
enum  _PIP_PROP_TARGET { PipTargetDenied , PipTargetBuiltin , PipTargetStore }
 

Functions

static BOOLEAN PiPropIsSameKey (_In_ const DEVPROPKEY *Key1, _In_ const DEVPROPKEY *Key2)
 
static BOOLEAN PiPropCheckElements (_In_ UCHAR Check, _In_reads_bytes_(Width *Count) PUCHAR Data, _In_ ULONG Width, _In_ ULONG Count)
 
static BOOLEAN PiPropIsValidString (_In_reads_bytes_(Size) PCWSTR String, _In_ ULONG Size)
 
static BOOLEAN PiPropIsValidStringList (_In_reads_bytes_(Size) PCWSTR List, _In_ ULONG Size)
 
static NTSTATUS PiPropCheckPayload (_In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
 
static NTSTATUS PiPropInitLocale (_Out_ PPIP_PROP_NAME Name, _In_ LCID Lcid)
 
static NTSTATUS PiPropInitName (_Out_ PPIP_PROP_NAME Name, _In_ const DEVPROPKEY *Key, _In_ LCID Lcid)
 
static BOOLEAN PiPropIsInterruptKey (_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name)
 
static NTSTATUS PiPropNormalizeStatus (_In_ NTSTATUS Status)
 
static NTSTATUS PiPropCopyOut (_In_ DEVPROPTYPE SourceType, _In_reads_bytes_opt_(SourceSize) PVOID Source, _In_ ULONG SourceSize, _Out_ PDEVPROPTYPE Type, _Out_writes_bytes_to_opt_(Size, *RequiredSize) PVOID Data, _In_ ULONG Size, _Out_ PULONG RequiredSize)
 
static BOOLEAN PiPropParseInterfaceName (_In_ PCUNICODE_STRING LinkName, _Out_ LPGUID ClassGuid)
 
static NTSTATUS NTAPI PiPropGetInterfaceReference (_In_ PCUNICODE_STRING LinkName, _Out_ PUNICODE_STRING Reference)
 
static NTSTATUS PiPropOpenObjectKey (_In_ PPIP_PROP_OBJECT Object, _In_ ACCESS_MASK DesiredAccess, _Out_ PHANDLE ObjectKey)
 
static NTSTATUS PiPropBuildValuePath (_In_ PPIP_PROP_NAME Name, _Out_ PUNICODE_STRING Path, _Out_writes_(PIP_PROP_PATH_CHARS) PWCHAR Buffer)
 
static NTSTATUS PiPropStoreQuery (_In_ HANDLE ObjectKey, _In_ PPIP_PROP_NAME Name, _Out_ PDEVPROPTYPE Type, _Out_writes_bytes_to_opt_(Size, *RequiredSize) PVOID Data, _In_ ULONG Size, _Out_ PULONG RequiredSize)
 
static NTSTATUS PiPropPutValue (_In_ HANDLE ValueKey, _In_ PPIP_PROP_NAME Name, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
 
static NTSTATUS PiPropCreateBranch (_In_ HANDLE Parent, _In_reads_(Depth) PCUNICODE_STRING *Parts, _In_ ULONG Depth, _In_ PPIP_PROP_NAME Name, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
 
static NTSTATUS PiPropStoreWrite (_In_ HANDLE ObjectKey, _In_ PPIP_PROP_NAME Name, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
 
static BOOLEAN PiPropIsKeyEmpty (_In_ HANDLE KeyHandle)
 
static NTSTATUS PiPropStoreDelete (_In_ HANDLE ObjectKey, _In_ PPIP_PROP_NAME Name)
 
static RTL_STATIC_LIST_HEAD (PiPropSavedValues)
 
static PPIP_PROP_SAVED_VALUE PiPropFindSaved (_In_ PDEVICE_OBJECT Pdo)
 
static NTSTATUS PiPropReplaceSaved (_In_ PDEVICE_OBJECT Pdo, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size, _Out_opt_ PBOOLEAN Replaced)
 
static const PIP_BUILTIN_PROPERTY * PiPropBuiltinTable (_In_ PIP_PROP_OBJECT_KIND Kind, _Out_ PULONG Count)
 
static const PIP_BUILTIN_PROPERTY * PiPropFindBuiltin (_In_ PPIP_PROP_OBJECT Object, _In_ const DEVPROPKEY *Key)
 
static NTSTATUS PiPropAllocateBlob (_In_reads_bytes_(Size) PVOID Source, _In_ ULONG Size, _Outptr_result_bytebuffer_maybenull_(Size) PVOID *Blob)
 
static NTSTATUS PiPropCaptureString (_In_reads_bytes_(RawSize) PCWSTR Raw, _In_ ULONG RawSize, _In_ BOOLEAN IsList, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
 
static NTSTATUS PiPropReadRegistryValue (_In_ HANDLE KeyHandle, _In_ PCWSTR ValueName, _In_ ULONG RegType, _In_ DEVPROPTYPE Type, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
 
static NTSTATUS PiPropReadKeyValue (_In_ PPIP_PROP_OBJECT Object, _In_ PCWSTR ValueName, _In_ ULONG RegType, _In_ DEVPROPTYPE Type, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
 
static NTSTATUS PiPropReadDeviceRegistryProperty (_In_ PPIP_PROP_OBJECT Object, _In_ const PIP_BUILTIN_PROPERTY *Builtin, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
 
static NTSTATUS PiPropReadDeviceNodeField (_In_ PPIP_PROP_OBJECT Object, _In_ PIP_PROP_FIELD Field, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
 
static NTSTATUS PiPropReadInterfaceField (_In_ PPIP_PROP_OBJECT Object, _In_ PIP_PROP_FIELD Field, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
 
static NTSTATUS PiPropReadBuiltin (_In_ PPIP_PROP_OBJECT Object, _In_ const PIP_BUILTIN_PROPERTY *Builtin, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
 
static NTSTATUS PiPropWriteBuiltin (_In_ PPIP_PROP_OBJECT Object, _In_ const PIP_BUILTIN_PROPERTY *Builtin, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
 
static BOOLEAN PiPropReadFromBuiltin (_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Inout_ PPIP_PROP_OUTPUT Out, _Out_ PNTSTATUS Status)
 
static BOOLEAN PiPropReadFromStore (_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Inout_ PPIP_PROP_OUTPUT Out, _Out_ PNTSTATUS Status)
 
static BOOLEAN PiPropReadFromSaved (_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Inout_ PPIP_PROP_OUTPUT Out, _Out_ PNTSTATUS Status)
 
static NTSTATUS PiPropGet (_In_ PPIP_PROP_OBJECT Object, _In_ const DEVPROPKEY *PropertyKey, _In_ LCID Lcid, _In_ ULONG Size, _Out_writes_bytes_to_opt_(Size, *RequiredSize) PVOID Data, _Out_ PULONG RequiredSize, _Out_ PDEVPROPTYPE Type)
 
static PIP_PROP_TARGET PiPropPickTarget (_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Out_ const PIP_BUILTIN_PROPERTY **Builtin)
 
static NTSTATUS PiPropStoreApply (_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
 
static BOOLEAN PiPropShouldAnnounce (_In_ PDEVICE_NODE DeviceNode)
 
static NTSTATUS PiPropSet (_In_ PPIP_PROP_OBJECT Object, _In_ const DEVPROPKEY *PropertyKey, _In_ LCID Lcid, _In_ DEVPROPTYPE Type, _In_ ULONG Size, _In_reads_bytes_opt_(Size) PVOID Data)
 
static NTSTATUS PiPropInitDeviceObject (_In_ PDEVICE_OBJECT Pdo, _Out_ PPIP_PROP_OBJECT Object)
 
static NTSTATUS PiPropInitInterfaceObject (_In_ PCUNICODE_STRING SymbolicLinkName, _Out_ PPIP_PROP_OBJECT Object)
 
VOID PiPropReleaseDevice (_In_ PDEVICE_OBJECT DeviceObject)
 
 _IRQL_requires_max_ (PASSIVE_LEVEL)
 

Variables

static const PIP_BUILTIN_PROPERTY PipDeviceBuiltins []
 
static const PIP_BUILTIN_PROPERTY PipInterfaceBuiltins []
 
static const DEVPROPKEY PiPropInterruptKey
 
static const PIP_PROP_TYPE_RULE PiPropTypeRules [MAX_DEVPROP_TYPE+1]
 
static EX_PUSH_LOCK PiPropSavedLock
 
static const PIP_PROP_READER PiPropReaders []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file pnpprop.c.

◆ PIP_PROP_FMTID_CHARS

#define PIP_PROP_FMTID_CHARS   (38 + 1)

Definition at line 23 of file pnpprop.c.

◆ PIP_PROP_MAX_QUERY_SIZE

#define PIP_PROP_MAX_QUERY_SIZE   0x10000

Definition at line 26 of file pnpprop.c.

◆ PIP_PROP_OBJECT_PROTECTED

#define PIP_PROP_OBJECT_PROTECTED   0x00000001

Definition at line 31 of file pnpprop.c.

◆ PIP_PROP_PATH_CHARS

#define PIP_PROP_PATH_CHARS   (10 + 1 + 38 + 1 + 8 + 1)

Definition at line 25 of file pnpprop.c.

◆ PIP_PROP_PID_CHARS

#define PIP_PROP_PID_CHARS   (8 + 1)

Definition at line 24 of file pnpprop.c.

◆ PIP_PROP_READ_ONLY

#define PIP_PROP_READ_ONLY   0x00000001

Definition at line 28 of file pnpprop.c.

◆ PIP_PROP_REG_TYPE_MARK

#define PIP_PROP_REG_TYPE_MARK   0xFFFF0000UL

Definition at line 21 of file pnpprop.c.

◆ PIP_PROP_ROOT_ENUM_WRITE

#define PIP_PROP_ROOT_ENUM_WRITE   0x00000002

Definition at line 29 of file pnpprop.c.

◆ TAG_PNP_PROPERTY

#define TAG_PNP_PROPERTY   'rPpP'

Definition at line 18 of file pnpprop.c.

Typedef Documentation

◆ PIP_BUILTIN_PROPERTY

◆ PIP_PROP_CHECK

◆ PIP_PROP_FIELD

◆ PIP_PROP_NAME

◆ PIP_PROP_OBJECT

◆ PIP_PROP_OBJECT_KIND

◆ PIP_PROP_OUTPUT

◆ PIP_PROP_READER

Definition at line 1408 of file pnpprop.c.

◆ PIP_PROP_SAVED_VALUE

◆ PIP_PROP_SOURCE

◆ PIP_PROP_TARGET

◆ PIP_PROP_TYPE_RULE

◆ PPIP_BUILTIN_PROPERTY

◆ PPIP_PROP_NAME

◆ PPIP_PROP_OBJECT

◆ PPIP_PROP_OUTPUT

◆ PPIP_PROP_SAVED_VALUE

Enumeration Type Documentation

◆ _PIP_PROP_CHECK

Enumerator
PipCheckNone 
PipCheckNoData 
PipCheckBoolean 
PipCheckFileTime 
PipCheckString 
PipCheckSecurity 

Definition at line 158 of file pnpprop.c.

159{
@ PipCheckBoolean
Definition: pnpprop.c:162
@ PipCheckSecurity
Definition: pnpprop.c:165
@ PipCheckNoData
Definition: pnpprop.c:161
@ PipCheckNone
Definition: pnpprop.c:160
@ PipCheckString
Definition: pnpprop.c:164
@ PipCheckFileTime
Definition: pnpprop.c:163
enum _PIP_PROP_CHECK PIP_PROP_CHECK

◆ _PIP_PROP_FIELD

Enumerator
PipFieldName 
PipFieldInstanceId 
PipFieldParent 
PipFieldStatus 
PipFieldProblemCode 
PipFieldHasProblem 
PipFieldIsPresent 
PipFieldInterfaceClass 
PipFieldInterfaceEnabled 
PipFieldInterfaceDevice 
PipFieldInterfaceReference 

Definition at line 70 of file pnpprop.c.

71{
enum _PIP_PROP_FIELD PIP_PROP_FIELD
@ PipFieldStatus
Definition: pnpprop.c:75
@ PipFieldIsPresent
Definition: pnpprop.c:78
@ PipFieldHasProblem
Definition: pnpprop.c:77
@ PipFieldParent
Definition: pnpprop.c:74
@ PipFieldInterfaceClass
Definition: pnpprop.c:79
@ PipFieldInterfaceEnabled
Definition: pnpprop.c:80
@ PipFieldInterfaceDevice
Definition: pnpprop.c:81
@ PipFieldInterfaceReference
Definition: pnpprop.c:82
@ PipFieldName
Definition: pnpprop.c:72
@ PipFieldProblemCode
Definition: pnpprop.c:76
@ PipFieldInstanceId
Definition: pnpprop.c:73

◆ _PIP_PROP_OBJECT_KIND

Enumerator
PipPropObjectDevice 
PipPropObjectInterface 

Definition at line 35 of file pnpprop.c.

36{
enum _PIP_PROP_OBJECT_KIND PIP_PROP_OBJECT_KIND
@ PipPropObjectDevice
Definition: pnpprop.c:37
@ PipPropObjectInterface
Definition: pnpprop.c:38

◆ _PIP_PROP_SOURCE

Enumerator
PipSourceKeyValue 
PipSourceRegistryProperty 
PipSourceDeviceNode 
PipSourceInterface 

Definition at line 62 of file pnpprop.c.

63{
enum _PIP_PROP_SOURCE PIP_PROP_SOURCE
@ PipSourceKeyValue
Definition: pnpprop.c:64
@ PipSourceRegistryProperty
Definition: pnpprop.c:65
@ PipSourceDeviceNode
Definition: pnpprop.c:66
@ PipSourceInterface
Definition: pnpprop.c:67

◆ _PIP_PROP_TARGET

Enumerator
PipTargetDenied 
PipTargetBuiltin 
PipTargetStore 

Definition at line 1542 of file pnpprop.c.

1543{
enum _PIP_PROP_TARGET PIP_PROP_TARGET
@ PipTargetDenied
Definition: pnpprop.c:1544
@ PipTargetStore
Definition: pnpprop.c:1546
@ PipTargetBuiltin
Definition: pnpprop.c:1545

Function Documentation

◆ _IRQL_requires_max_()

_IRQL_requires_max_ ( PASSIVE_LEVEL  )

Definition at line 1745 of file pnpprop.c.

1757{
1760
1761 PAGED_CODE();
1762
1764
1766 if (!NT_SUCCESS(Status))
1767 return Status;
1768
1769 /* A NULL buffer deletes the property */
1770 if (!Data)
1771 {
1773 Size = 0;
1774 }
1775
1777}
#define PAGED_CODE()
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
#define DEVPROP_TYPE_EMPTY
Definition: devpropdef.h:29
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:24
_In_ UCXUSBDEVICE _In_ PDEVICE_OBJECT Pdo
Definition: hubucx.h:280
_Out_ PLCID Lcid
Definition: rtlfuncs.h:5207
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
static NTSTATUS PiPropSet(_In_ PPIP_PROP_OBJECT Object, _In_ const DEVPROPKEY *PropertyKey, _In_ LCID Lcid, _In_ DEVPROPTYPE Type, _In_ ULONG Size, _In_reads_bytes_opt_(Size) PVOID Data)
Definition: pnpprop.c:1629
static NTSTATUS PiPropInitDeviceObject(_In_ PDEVICE_OBJECT Pdo, _Out_ PPIP_PROP_OBJECT Object)
Definition: pnpprop.c:1683
_In_ PSP_DEVINFO_DATA _In_ const DEVPROPKEY * PropertyKey
Definition: setupapi.h:1667
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539

◆ PiPropAllocateBlob()

static NTSTATUS PiPropAllocateBlob ( _In_reads_bytes_(Size) PVOID  Source,
_In_ ULONG  Size,
_Outptr_result_bytebuffer_maybenull_(Size) PVOID *  Blob 
)
static

Definition at line 919 of file pnpprop.c.

923{
924 *Blob = NULL;
925 if (Size == 0)
927
929 if (!*Blob)
931
932 RtlCopyMemory(*Blob, Source, Size);
933 return STATUS_SUCCESS;
934}
#define NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
#define TAG_PNP_PROPERTY
Definition: pnpprop.c:18
#define STATUS_SUCCESS
Definition: shellext.h:65
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

Referenced by PiPropReadDeviceNodeField(), PiPropReadInterfaceField(), and PiPropReadRegistryValue().

◆ PiPropBuildValuePath()

static NTSTATUS PiPropBuildValuePath ( _In_ PPIP_PROP_NAME  Name,
_Out_ PUNICODE_STRING  Path,
_Out_writes_(PIP_PROP_PATH_CHARS) PWCHAR  Buffer 
)
static

Definition at line 555 of file pnpprop.c.

559{
560 RtlInitEmptyUnicodeString(Path, Buffer, PIP_PROP_PATH_CHARS * sizeof(WCHAR));
562 L"%s\\%wZ\\%wZ",
564 &Name->Fmtid,
565 &Name->Pid);
566}
PRTL_UNICODE_STRING_BUFFER Path
Definition: bufpool.h:45
LPWSTR Name
Definition: desk.c:124
#define L(x)
Definition: resources.c:13
NTSTRSAFEVAPI RtlUnicodeStringPrintf(_In_ PUNICODE_STRING DestinationString, _In_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:3241
short WCHAR
Definition: pedump.c:58
#define PIP_PROP_PATH_CHARS
Definition: pnpprop.c:25
#define REGSTR_KEY_DEVICE_PROPERTIES
Definition: regstr.h:752

Referenced by PiPropStoreQuery(), and PiPropStoreWrite().

◆ PiPropBuiltinTable()

static const PIP_BUILTIN_PROPERTY * PiPropBuiltinTable ( _In_ PIP_PROP_OBJECT_KIND  Kind,
_Out_ PULONG  Count 
)
static

Definition at line 878 of file pnpprop.c.

881{
882 switch (Kind)
883 {
886 return PipDeviceBuiltins;
887
891
892 default:
893 *Count = 0;
894 return NULL;
895 }
896}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
int Count
Definition: noreturn.cpp:7
static const PIP_BUILTIN_PROPERTY PipDeviceBuiltins[]
Definition: pnpprop.c:97
static const PIP_BUILTIN_PROPERTY PipInterfaceBuiltins[]
Definition: pnpprop.c:132

Referenced by PiPropFindBuiltin().

◆ PiPropCaptureString()

static NTSTATUS PiPropCaptureString ( _In_reads_bytes_(RawSize) PCWSTR  Raw,
_In_ ULONG  RawSize,
_In_ BOOLEAN  IsList,
_Outptr_result_bytebuffer_maybenull_ *BlobSize PVOID *  Blob,
_Out_ PULONG  BlobSize 
)
static

Definition at line 938 of file pnpprop.c.

944{
945 ULONG RawChars = RawSize / sizeof(WCHAR);
946 ULONG Index, Out = 0;
947 BOOLEAN InEntry = FALSE;
949
950 String = ExAllocatePoolWithTag(PagedPool, (RawChars + 2) * sizeof(WCHAR), TAG_PNP_PROPERTY);
951 if (!String)
953
954 *Blob = String;
955
956 for (Index = 0; Index < RawChars; Index++)
957 {
958 if (Raw[Index] != UNICODE_NULL)
959 {
960 String[Out++] = Raw[Index];
961 InEntry = TRUE;
962 continue;
963 }
964
965 if (!IsList || !InEntry)
966 break;
967
969 InEntry = FALSE;
970 }
971
972 if (!IsList || InEntry)
974 if (IsList)
976
977 *BlobSize = Out * sizeof(WCHAR);
978 return STATUS_SUCCESS;
979}
unsigned char BOOLEAN
Definition: actypes.h:127
@ Out
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
@ Raw
Definition: sacdrv.h:279
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2439

Referenced by PiPropReadDeviceNodeField(), PiPropReadDeviceRegistryProperty(), PiPropReadInterfaceField(), and PiPropReadRegistryValue().

◆ PiPropCheckElements()

static BOOLEAN PiPropCheckElements ( _In_ UCHAR  Check,
_In_reads_bytes_(Width *Count) PUCHAR  Data,
_In_ ULONG  Width,
_In_ ULONG  Count 
)
static

Definition at line 208 of file pnpprop.c.

213{
215
216 for (; Count; Count--, Data += Width)
217 {
218 if (Check == PipCheckBoolean)
219 {
222 return FALSE;
223 }
224 else if (Check == PipCheckFileTime)
225 {
226 RtlCopyMemory(&Time, Data, sizeof(Time));
227 if (Time < 0)
228 return FALSE;
229 }
230 }
231
232 return TRUE;
233}
#define DEVPROP_FALSE
Definition: devpropdef.h:67
#define DEVPROP_TRUE
Definition: devpropdef.h:66
CHAR * PDEVPROP_BOOLEAN
Definition: devpropdef.h:64
_Check_return_ _In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS _Out_ UINT * Width
Definition: dispmprt.h:1444
static PLARGE_INTEGER Time
Definition: time.c:37
int Check()
Definition: movefile.cpp:196
int64_t LONGLONG
Definition: typedefs.h:68

Referenced by PiPropCheckPayload().

◆ PiPropCheckPayload()

static NTSTATUS PiPropCheckPayload ( _In_ DEVPROPTYPE  Type,
_In_reads_bytes_opt_(Size) PVOID  Data,
_In_ ULONG  Size 
)
static

Definition at line 292 of file pnpprop.c.

296{
298 const PIP_PROP_TYPE_RULE *Rule;
299 BOOLEAN Valid;
300
301 if ((BaseType > MAX_DEVPROP_TYPE) || (Size && !Data))
303
304 Rule = &PiPropTypeRules[BaseType];
305
306 /* Everything above the base type must be a single known modifier */
307 switch (Type - BaseType)
308 {
309 case 0:
310 if (Rule->Width)
311 Valid = (Size == Rule->Width);
312 else if (Rule->Check == PipCheckNoData)
313 Valid = (Size == 0);
314 else if (Rule->Check == PipCheckString)
315 Valid = PiPropIsValidString(Data, Size);
316 else
317 Valid = (Size != 0) &&
320 break;
321
323 Valid = (Rule->Width != 0) && (Size != 0) && !(Size % Rule->Width);
324 break;
325
327 Valid = Rule->ListAllowed && PiPropIsValidStringList(Data, Size);
328 break;
329
330 default:
331 Valid = FALSE;
332 break;
333 }
334
335 if (Valid && Rule->Width && (Rule->Check != PipCheckNone))
336 Valid = PiPropCheckElements(Rule->Check, Data, Rule->Width, Size / Rule->Width);
337
339}
ULONG DEVPROPTYPE
Definition: devpropdef.h:24
#define MAX_DEVPROP_TYPE
Definition: devpropdef.h:58
#define DEVPROP_TYPEMOD_LIST
Definition: devpropdef.h:27
#define DEVPROP_TYPEMOD_ARRAY
Definition: devpropdef.h:26
#define DEVPROP_MASK_TYPE
Definition: devpropdef.h:61
static BOOLEAN PiPropIsValidStringList(_In_reads_bytes_(Size) PCWSTR List, _In_ ULONG Size)
Definition: pnpprop.c:261
static const PIP_PROP_TYPE_RULE PiPropTypeRules[MAX_DEVPROP_TYPE+1]
Definition: pnpprop.c:176
static BOOLEAN PiPropIsValidString(_In_reads_bytes_(Size) PCWSTR String, _In_ ULONG Size)
Definition: pnpprop.c:237
static BOOLEAN PiPropCheckElements(_In_ UCHAR Check, _In_reads_bytes_(Width *Count) PUCHAR Data, _In_ ULONG Width, _In_ ULONG Count)
Definition: pnpprop.c:208
BOOLEAN ListAllowed
Definition: pnpprop.c:171
NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR)
NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR, ULONG, SECURITY_INFORMATION)

Referenced by PiPropSet().

◆ PiPropCopyOut()

static NTSTATUS PiPropCopyOut ( _In_ DEVPROPTYPE  SourceType,
_In_reads_bytes_opt_(SourceSize) PVOID  Source,
_In_ ULONG  SourceSize,
_Out_ PDEVPROPTYPE  Type,
_Out_writes_bytes_to_opt_(Size, *RequiredSize) PVOID  Data,
_In_ ULONG  Size,
_Out_ PULONG  RequiredSize 
)
static

Definition at line 427 of file pnpprop.c.

435{
436 *Type = SourceType;
437 *RequiredSize = SourceSize;
438
439 /* An empty buffer only satisfies DEVPROP_TYPE_NULL */
440 if ((Size < SourceSize) || (!Size && (SourceType != DEVPROP_TYPE_NULL)))
442
443 if (SourceSize)
444 RtlCopyMemory(Data, Source, SourceSize);
445
446 return STATUS_SUCCESS;
447}
#define DEVPROP_TYPE_NULL
Definition: devpropdef.h:30
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4445

Referenced by PiPropReadFromBuiltin(), PiPropReadFromSaved(), and PiPropStoreQuery().

◆ PiPropCreateBranch()

static NTSTATUS PiPropCreateBranch ( _In_ HANDLE  Parent,
_In_reads_(Depth) PCUNICODE_STRING *  Parts,
_In_ ULONG  Depth,
_In_ PPIP_PROP_NAME  Name,
_In_ DEVPROPTYPE  Type,
_In_reads_bytes_opt_(Size) PVOID  Data,
_In_ ULONG  Size 
)
static

Definition at line 667 of file pnpprop.c.

675{
680
684 {
687 }
688 if (!NT_SUCCESS(Status))
689 return Status;
690
691 if (Depth > 1)
692 Status = PiPropCreateBranch(Child, Parts + 1, Depth - 1, Name, Type, Data, Size);
693 else
695
697 ZwDeleteKey(Child);
698
699 ZwClose(Child);
700 return Status;
701}
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
UINT Depth
Definition: d3d12.idl:4644
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:56
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1021
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1060
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1087
#define DELETE
Definition: nt_native.h:57
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1063
#define KEY_SET_VALUE
Definition: nt_native.h:1020
NTSTATUS NTAPI IopCreateRegistryKeyEx(OUT PHANDLE Handle, IN HANDLE BaseHandle OPTIONAL, IN PUNICODE_STRING KeyName, IN ACCESS_MASK DesiredAccess, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
#define STATUS_CHILD_MUST_BE_VOLATILE
Definition: ntstatus.h:712
static NTSTATUS PiPropCreateBranch(_In_ HANDLE Parent, _In_reads_(Depth) PCUNICODE_STRING *Parts, _In_ ULONG Depth, _In_ PPIP_PROP_NAME Name, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
Definition: pnpprop.c:667
static NTSTATUS PiPropPutValue(_In_ HANDLE ValueKey, _In_ PPIP_PROP_NAME Name, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
Definition: pnpprop.c:650
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536

Referenced by PiPropCreateBranch(), and PiPropStoreWrite().

◆ PiPropFindBuiltin()

static const PIP_BUILTIN_PROPERTY * PiPropFindBuiltin ( _In_ PPIP_PROP_OBJECT  Object,
_In_ const DEVPROPKEY *  Key 
)
static

Definition at line 900 of file pnpprop.c.

903{
905 ULONG Count;
906
908 for (; Count; Count--, Table++)
909 {
910 if (PiPropIsSameKey(Table->Key, Key))
911 return Table;
912 }
913
914 return NULL;
915}
ASMGENDATA Table[]
Definition: genincdata.c:61
static BOOLEAN PiPropIsSameKey(_In_ const DEVPROPKEY *Key1, _In_ const DEVPROPKEY *Key2)
Definition: pnpprop.c:150
static const PIP_BUILTIN_PROPERTY * PiPropBuiltinTable(_In_ PIP_PROP_OBJECT_KIND Kind, _Out_ PULONG Count)
Definition: pnpprop.c:878

Referenced by PiPropPickTarget(), and PiPropReadFromBuiltin().

◆ PiPropFindSaved()

static PPIP_PROP_SAVED_VALUE PiPropFindSaved ( _In_ PDEVICE_OBJECT  Pdo)
static

Definition at line 810 of file pnpprop.c.

812{
815
816 for (Entry = PiPropSavedValues.Flink; Entry != &PiPropSavedValues; Entry = Entry->Flink)
817 {
819 if (Saved->Pdo == Pdo)
820 return Saved;
821 }
822
823 return NULL;
824}
Entry
Definition: section.c:5216
Definition: typedefs.h:120
PDEVICE_OBJECT Pdo
Definition: pnpprop.c:798
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
static int Link(const char **args)
Definition: vfdcmd.c:2414

Referenced by PiPropReadFromSaved(), and PiPropReplaceSaved().

◆ PiPropGet()

static NTSTATUS PiPropGet ( _In_ PPIP_PROP_OBJECT  Object,
_In_ const DEVPROPKEY *  PropertyKey,
_In_ LCID  Lcid,
_In_ ULONG  Size,
_Out_writes_bytes_to_opt_(Size, *RequiredSize) PVOID  Data,
_Out_ PULONG  RequiredSize,
_Out_ PDEVPROPTYPE  Type 
)
static

Definition at line 1505 of file pnpprop.c.

1513{
1517 ULONG Index;
1518
1519 PAGED_CODE();
1520
1521 if (!PropertyKey || !RequiredSize || !Type)
1523
1525 if (NT_SUCCESS(Status))
1526 {
1529 {
1531 break;
1532 }
1533 }
1534
1535 *RequiredSize = Out.Required;
1536 *Type = Out.Type;
1538}
static NTSTATUS PiPropInitName(_Out_ PPIP_PROP_NAME Name, _In_ const DEVPROPKEY *Key, _In_ LCID Lcid)
Definition: pnpprop.c:362
static NTSTATUS PiPropNormalizeStatus(_In_ NTSTATUS Status)
Definition: pnpprop.c:412
static const PIP_PROP_READER PiPropReaders[]
Definition: pnpprop.c:1496
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149

◆ PiPropGetInterfaceReference()

static NTSTATUS NTAPI PiPropGetInterfaceReference ( _In_ PCUNICODE_STRING  LinkName,
_Out_ PUNICODE_STRING  Reference 
)
static

Definition at line 488 of file pnpprop.c.

491{
492 USHORT Start, End, Chars;
493
494 /* Both link prefixes are four characters */
495 Chars = LinkName->Length / sizeof(WCHAR);
496 Start = 4;
497 while ((Start < Chars) && (LinkName->Buffer[Start] != L'\\'))
498 Start++;
499
500 if (Start >= Chars)
502
503 Start++;
504 for (End = Start; End < Chars; End++)
505 {
506 if ((LinkName->Buffer[End] == L'\\') || (LinkName->Buffer[End] == L'/'))
508 }
509
510 Reference->Buffer = &LinkName->Buffer[Start];
511 Reference->Length = (End - Start) * sizeof(WCHAR);
512 Reference->MaximumLength = Reference->Length;
513 return STATUS_SUCCESS;
514}
static _Out_opt_ PULONGLONG Start
#define STATUS_OBJECT_PATH_INVALID
Definition: ntstatus.h:387
unsigned short USHORT
Definition: pedump.c:61

Referenced by PiPropReadInterfaceField().

◆ PiPropInitDeviceObject()

static NTSTATUS PiPropInitDeviceObject ( _In_ PDEVICE_OBJECT  Pdo,
_Out_ PPIP_PROP_OBJECT  Object 
)
static

Definition at line 1683 of file pnpprop.c.

1686{
1688
1690 {
1691 DPRINT1("%p is not a PDO\n", Pdo);
1692 KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)Pdo, 0, 0);
1693 }
1694
1695 if (!DeviceNode->InstancePath.Length)
1697
1698 RtlZeroMemory(Object, sizeof(*Object));
1700 Object->Pdo = Pdo;
1701 Object->DeviceNode = DeviceNode;
1702 Object->Name = &DeviceNode->InstancePath;
1703
1706
1707 return STATUS_SUCCESS;
1708}
@ DeviceNode
Definition: Node.h:9
#define DPRINT1
Definition: precomp.h:8
DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx(IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4)
Definition: debug.c:485
#define DNF_LEGACY_RESOURCE_DEVICENODE
Definition: iotypes.h:192
PDEVICE_NODE FASTCALL IopGetDeviceNode(IN PDEVICE_OBJECT DeviceObject)
PDEVICE_NODE IopRootDeviceNode
Definition: devnode.c:18
#define PIP_PROP_OBJECT_PROTECTED
Definition: pnpprop.c:31
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138

Referenced by _IRQL_requires_max_().

◆ PiPropInitInterfaceObject()

static NTSTATUS PiPropInitInterfaceObject ( _In_ PCUNICODE_STRING  SymbolicLinkName,
_Out_ PPIP_PROP_OBJECT  Object 
)
static

Definition at line 1712 of file pnpprop.c.

1715{
1716 RtlZeroMemory(Object, sizeof(*Object));
1717
1718 if (!SymbolicLinkName || !SymbolicLinkName->Buffer || !SymbolicLinkName->Length ||
1720 {
1722 }
1723
1725 Object->Name = SymbolicLinkName;
1726 return STATUS_SUCCESS;
1727}
_In_ PUNICODE_STRING SymbolicLinkName
Definition: hubucx.h:491
static BOOLEAN PiPropParseInterfaceName(_In_ PCUNICODE_STRING LinkName, _Out_ LPGUID ClassGuid)
Definition: pnpprop.c:452

◆ PiPropInitLocale()

static NTSTATUS PiPropInitLocale ( _Out_ PPIP_PROP_NAME  Name,
_In_ LCID  Lcid 
)
static

Definition at line 343 of file pnpprop.c.

346{
347 RtlInitEmptyUnicodeString(&Name->Locale,
348 Name->LocaleBuffer,
349 sizeof(Name->LocaleBuffer));
350
351 if ((Lcid != LOCALE_NEUTRAL) && !RtlLCIDToCultureName(Lcid, &Name->Locale))
352 {
353 DPRINT1("Cannot resolve LCID 0x%lx\n", Lcid);
354 return STATUS_UNSUCCESSFUL;
355 }
356
357 return STATUS_SUCCESS;
358}
#define LOCALE_NEUTRAL
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

Referenced by PiPropInitName().

◆ PiPropInitName()

static NTSTATUS PiPropInitName ( _Out_ PPIP_PROP_NAME  Name,
_In_ const DEVPROPKEY *  Key,
_In_ LCID  Lcid 
)
static

Definition at line 362 of file pnpprop.c.

366{
367 const GUID *Fmtid = &Key->fmtid;
369
370 Name->Key = Key;
371
373 if (!NT_SUCCESS(Status))
374 return Status;
375
376 Status = RtlStringCchPrintfW(Name->FmtidBuffer,
377 RTL_NUMBER_OF(Name->FmtidBuffer),
378 L"{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
379 Fmtid->Data1, Fmtid->Data2, Fmtid->Data3,
380 Fmtid->Data4[0], Fmtid->Data4[1],
381 Fmtid->Data4[2], Fmtid->Data4[3],
382 Fmtid->Data4[4], Fmtid->Data4[5],
383 Fmtid->Data4[6], Fmtid->Data4[7]);
384 if (!NT_SUCCESS(Status))
385 return Status;
386
387 Status = RtlStringCchPrintfW(Name->PidBuffer,
388 RTL_NUMBER_OF(Name->PidBuffer),
389 L"%04lX",
390 Key->pid);
391 if (!NT_SUCCESS(Status))
392 return Status;
393
394 RtlInitUnicodeString(&Name->Fmtid, Name->FmtidBuffer);
395 RtlInitUnicodeString(&Name->Pid, Name->PidBuffer);
396 return STATUS_SUCCESS;
397}
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1110
static NTSTATUS PiPropInitLocale(_Out_ PPIP_PROP_NAME Name, _In_ LCID Lcid)
Definition: pnpprop.c:343

Referenced by PiPropGet(), and PiPropSet().

◆ PiPropIsInterruptKey()

static BOOLEAN PiPropIsInterruptKey ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PPIP_PROP_NAME  Name 
)
static

Definition at line 401 of file pnpprop.c.

404{
405 return (Object->Pdo != NULL) &&
406 (Name->Locale.Length == 0) &&
408}
static const DEVPROPKEY PiPropInterruptKey
Definition: pnpprop.c:140

Referenced by PiPropReadFromSaved(), and PiPropStoreApply().

◆ PiPropIsKeyEmpty()

static BOOLEAN PiPropIsKeyEmpty ( _In_ HANDLE  KeyHandle)
static

Definition at line 734 of file pnpprop.c.

736{
737 struct
738 {
740 WCHAR ClassName[32];
741 } Buffer;
744
745 Status = ZwQueryKey(KeyHandle,
747 &Buffer,
748 sizeof(Buffer),
749 &ResultLength);
750
751 return NT_SUCCESS(Status) &&
752 (Buffer.Info.SubKeys == 0) &&
753 (Buffer.Info.Values == 0);
754}
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
@ KeyFullInformation
Definition: nt_native.h:1136
_In_ PGUID _In_ ULONG _Out_ PULONG ResultLength
Definition: ucxcontroller.h:83
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by PiPropStoreDelete().

◆ PiPropIsSameKey()

static BOOLEAN PiPropIsSameKey ( _In_ const DEVPROPKEY *  Key1,
_In_ const DEVPROPKEY *  Key2 
)
inlinestatic

Definition at line 150 of file pnpprop.c.

153{
154 return (Key1->pid == Key2->pid) &&
155 RtlEqualMemory(&Key1->fmtid, &Key2->fmtid, sizeof(GUID));
156}
#define RtlEqualMemory(dst, src, len)
Definition: kdvm.h:18

Referenced by PiPropFindBuiltin(), and PiPropIsInterruptKey().

◆ PiPropIsValidString()

static BOOLEAN PiPropIsValidString ( _In_reads_bytes_(Size) PCWSTR  String,
_In_ ULONG  Size 
)
static

Definition at line 237 of file pnpprop.c.

240{
241 ULONG Chars, Index;
242
243 if ((Size < sizeof(WCHAR)) || (Size % sizeof(WCHAR)) ||
245 {
246 return FALSE;
247 }
248
249 Chars = Size / sizeof(WCHAR);
250 for (Index = 0; Index < Chars - 1; Index++)
251 {
252 if (String[Index] == UNICODE_NULL)
253 return FALSE;
254 }
255
256 return (String[Chars - 1] == UNICODE_NULL);
257}
#define UNICODE_STRING_MAX_BYTES

Referenced by PiPropCheckPayload().

◆ PiPropIsValidStringList()

static BOOLEAN PiPropIsValidStringList ( _In_reads_bytes_(Size) PCWSTR  List,
_In_ ULONG  Size 
)
static

Definition at line 261 of file pnpprop.c.

264{
265 ULONG Chars, Index, EntryStart;
266
267 if ((Size < sizeof(WCHAR)) || (Size % sizeof(WCHAR)))
268 return FALSE;
269
270 Chars = Size / sizeof(WCHAR);
271 EntryStart = 0;
272
273 for (Index = 0; Index < Chars; Index++)
274 {
275 if (List[Index] != UNICODE_NULL)
276 continue;
277
278 if (Index == EntryStart)
279 return (Index == Chars - 1);
280
281 if ((Index - EntryStart + 1) * sizeof(WCHAR) > UNICODE_STRING_MAX_BYTES)
282 return FALSE;
283
284 EntryStart = Index + 1;
285 }
286
287 return FALSE;
288}
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by PiPropCheckPayload().

◆ PiPropNormalizeStatus()

static NTSTATUS PiPropNormalizeStatus ( _In_ NTSTATUS  Status)
static

Definition at line 412 of file pnpprop.c.

414{
415 if ((Status == STATUS_NOT_FOUND) ||
418 {
420 }
421
422 return Status;
423}
#define STATUS_KEY_DELETED
Definition: ntstatus.h:707
#define STATUS_NOT_FOUND
Definition: shellext.h:72
#define STATUS_OBJECT_PATH_NOT_FOUND
Definition: udferr_usr.h:151

Referenced by PiPropGet(), PiPropReadFromStore(), PiPropSet(), and PiPropStoreApply().

◆ PiPropOpenObjectKey()

static NTSTATUS PiPropOpenObjectKey ( _In_ PPIP_PROP_OBJECT  Object,
_In_ ACCESS_MASK  DesiredAccess,
_Out_ PHANDLE  ObjectKey 
)
static

Definition at line 520 of file pnpprop.c.

524{
525 UNICODE_STRING EnumKeyName =
526 RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum");
529
530 *ObjectKey = NULL;
531
532 switch (Object->Kind)
533 {
535 return IopOpenDeviceInterfaceKeys(Object->Name, DesiredAccess, NULL, ObjectKey);
536
537 default:
538 break;
539 }
540
541 Status = IopOpenRegistryKeyEx(&EnumKey, NULL, &EnumKeyName, KEY_READ);
542 if (!NT_SUCCESS(Status))
543 return Status;
544
545 Status = IopOpenRegistryKeyEx(ObjectKey,
546 EnumKey,
547 (PUNICODE_STRING)Object->Name,
550 return Status;
551}
#define RTL_CONSTANT_STRING(s)
Definition: combase.c:35
static LONG WINAPI EnumKey(HANDLE hcKey, DWORD dwIndex, LPWSTR pszName, PDWORD pcchName, PFILETIME pftLastWriteTime, HANDLE hSpooler)
Definition: localmon.c:169
#define KEY_READ
Definition: nt_native.h:1026
NTSTATUS NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, ACCESS_MASK DesiredAccess)
Definition: pnpmgr.c:885
NTSTATUS IopOpenDeviceInterfaceKeys(_In_ PCUNICODE_STRING SymbolicLinkName, _In_ ACCESS_MASK DesiredAccess, _Out_opt_ PHANDLE DeviceKey, _Out_opt_ PHANDLE InstanceKey)
Definition: deviface.c:570
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2664

Referenced by PiPropReadFromStore(), PiPropReadKeyValue(), PiPropStoreApply(), and PiPropWriteBuiltin().

◆ PiPropParseInterfaceName()

static BOOLEAN PiPropParseInterfaceName ( _In_ PCUNICODE_STRING  LinkName,
_Out_ LPGUID  ClassGuid 
)
static

Definition at line 452 of file pnpprop.c.

455{
456 static const UNICODE_STRING KernelPrefix = RTL_CONSTANT_STRING(L"\\??\\");
457 static const UNICODE_STRING UserPrefix = RTL_CONSTANT_STRING(L"\\\\?\\");
459 USHORT Index, Chars;
460
461 if (LinkName->Length % sizeof(WCHAR))
462 return FALSE;
463
464 if (!RtlPrefixUnicodeString(&KernelPrefix, LinkName, FALSE) &&
465 !RtlPrefixUnicodeString(&UserPrefix, LinkName, FALSE))
466 {
467 return FALSE;
468 }
469
470 Chars = LinkName->Length / sizeof(WCHAR);
471 Index = 4;
472 while ((Index < Chars) && (LinkName->Buffer[Index] != L'\\'))
473 Index++;
474
475 if (Index < 4 + 1 + 38)
476 return FALSE;
477
478 GuidString.Buffer = &LinkName->Buffer[Index - 38];
479 GuidString.Length = GuidString.MaximumLength = 38 * sizeof(WCHAR);
480
481 return NT_SUCCESS(RtlGUIDFromString(&GuidString, ClassGuid));
482}
static PWSTR GuidString
Definition: apphelp.c:93
NTSYSAPI BOOLEAN NTAPI RtlPrefixUnicodeString(IN PUNICODE_STRING String1, IN PUNICODE_STRING String2, IN BOOLEAN CaseInSensitive)
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)

Referenced by PiPropInitInterfaceObject().

◆ PiPropPickTarget()

static PIP_PROP_TARGET PiPropPickTarget ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PPIP_PROP_NAME  Name,
_Out_ const PIP_BUILTIN_PROPERTY **  Builtin 
)
static

Definition at line 1551 of file pnpprop.c.

1555{
1556 *Builtin = NULL;
1557
1558 /* Localized values are still allowed on a protected object */
1559 if ((Object->Flags & PIP_PROP_OBJECT_PROTECTED) && !Name->Locale.Length)
1560 return PipTargetDenied;
1561
1562 if (!Name->Locale.Length)
1563 *Builtin = PiPropFindBuiltin(Object, Name->Key);
1564
1565 return *Builtin ? PipTargetBuiltin : PipTargetStore;
1566}
static const PIP_BUILTIN_PROPERTY * PiPropFindBuiltin(_In_ PPIP_PROP_OBJECT Object, _In_ const DEVPROPKEY *Key)
Definition: pnpprop.c:900

Referenced by PiPropSet().

◆ PiPropPutValue()

static NTSTATUS PiPropPutValue ( _In_ HANDLE  ValueKey,
_In_ PPIP_PROP_NAME  Name,
_In_ DEVPROPTYPE  Type,
_In_reads_bytes_opt_(Size) PVOID  Data,
_In_ ULONG  Size 
)
static

Definition at line 650 of file pnpprop.c.

656{
657 return ZwSetValueKey(ValueKey,
658 &Name->Locale,
659 0,
661 Data,
662 Size);
663}
#define PIP_PROP_REG_TYPE_MARK
Definition: pnpprop.c:21

Referenced by PiPropCreateBranch(), and PiPropStoreWrite().

◆ PiPropReadBuiltin()

static NTSTATUS PiPropReadBuiltin ( _In_ PPIP_PROP_OBJECT  Object,
_In_ const PIP_BUILTIN_PROPERTY *  Builtin,
_Outptr_result_bytebuffer_maybenull_ *BlobSize PVOID *  Blob,
_Out_ PULONG  BlobSize 
)
static

Definition at line 1300 of file pnpprop.c.

1305{
1306 switch (Builtin->Source)
1307 {
1308 case PipSourceKeyValue:
1310 Builtin->ValueName,
1311 Builtin->Selector,
1312 Builtin->Type,
1313 Blob,
1314 BlobSize);
1315
1317 return PiPropReadDeviceRegistryProperty(Object, Builtin, Blob, BlobSize);
1318
1320 return PiPropReadDeviceNodeField(Object, Builtin->Selector, Blob, BlobSize);
1321
1322 case PipSourceInterface:
1323 return PiPropReadInterfaceField(Object, Builtin->Selector, Blob, BlobSize);
1324
1325 default:
1326 ASSERT(FALSE);
1327 return STATUS_INTERNAL_ERROR;
1328 }
1329}
#define ASSERT(a)
Definition: mode.c:44
#define STATUS_INTERNAL_ERROR
Definition: ntstatus.h:559
static NTSTATUS PiPropReadKeyValue(_In_ PPIP_PROP_OBJECT Object, _In_ PCWSTR ValueName, _In_ ULONG RegType, _In_ DEVPROPTYPE Type, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
Definition: pnpprop.c:1069
static NTSTATUS PiPropReadInterfaceField(_In_ PPIP_PROP_OBJECT Object, _In_ PIP_PROP_FIELD Field, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
Definition: pnpprop.c:1229
static NTSTATUS PiPropReadDeviceRegistryProperty(_In_ PPIP_PROP_OBJECT Object, _In_ const PIP_BUILTIN_PROPERTY *Builtin, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
Definition: pnpprop.c:1091
static NTSTATUS PiPropReadDeviceNodeField(_In_ PPIP_PROP_OBJECT Object, _In_ PIP_PROP_FIELD Field, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
Definition: pnpprop.c:1151

Referenced by PiPropReadFromBuiltin().

◆ PiPropReadDeviceNodeField()

static NTSTATUS PiPropReadDeviceNodeField ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PIP_PROP_FIELD  Field,
_Outptr_result_bytebuffer_maybenull_ *BlobSize PVOID *  Blob,
_Out_ PULONG  BlobSize 
)
static

Definition at line 1151 of file pnpprop.c.

1156{
1157 PDEVICE_NODE DeviceNode = Object->DeviceNode;
1158 DEVPROP_BOOLEAN Boolean;
1159 ULONG Value;
1161
1162 switch (Field)
1163 {
1164 case PipFieldName:
1166 DEVPROP_TYPE_STRING, Blob, BlobSize);
1168 {
1170 DEVPROP_TYPE_STRING, Blob, BlobSize);
1171 }
1172 return Status;
1173
1174 case PipFieldInstanceId:
1175 return PiPropCaptureString(Object->Name->Buffer,
1176 Object->Name->Length,
1177 FALSE,
1178 Blob,
1179 BlobSize);
1180
1181 case PipFieldIsPresent:
1182 Boolean = (DeviceNode && !(DeviceNode->Flags & DNF_DEVICE_GONE)) ? DEVPROP_TRUE : DEVPROP_FALSE;
1183 *BlobSize = sizeof(Boolean);
1184 return PiPropAllocateBlob(&Boolean, sizeof(Boolean), Blob);
1185
1186 default:
1187 break;
1188 }
1189
1190 if (!DeviceNode)
1192
1193 switch (Field)
1194 {
1195 case PipFieldParent:
1196 if (!DeviceNode->Parent)
1198
1199 return PiPropCaptureString(DeviceNode->Parent->InstancePath.Buffer,
1200 DeviceNode->Parent->InstancePath.Length,
1201 FALSE,
1202 Blob,
1203 BlobSize);
1204
1205 case PipFieldStatus:
1207 break;
1208
1210 Value = DeviceNode->Problem;
1211 break;
1212
1213 case PipFieldHasProblem:
1214 Boolean = (DeviceNode->Flags & DNF_HAS_PROBLEM) ? DEVPROP_TRUE : DEVPROP_FALSE;
1215 *BlobSize = sizeof(Boolean);
1216 return PiPropAllocateBlob(&Boolean, sizeof(Boolean), Blob);
1217
1218 default:
1219 ASSERT(FALSE);
1220 return STATUS_INTERNAL_ERROR;
1221 }
1222
1223 *BlobSize = sizeof(Value);
1224 return PiPropAllocateBlob(&Value, sizeof(Value), Blob);
1225}
#define REG_SZ
Definition: layer.c:22
CHAR DEVPROP_BOOLEAN
Definition: devpropdef.h:64
#define DEVPROP_TYPE_STRING
Definition: devpropdef.h:47
#define DNF_DEVICE_GONE
Definition: iotypes.h:191
#define DNF_HAS_PROBLEM
Definition: iotypes.h:188
ULONG IopGetDeviceNodeStatus(_In_ PDEVICE_NODE DeviceNode)
Definition: plugplay.c:905
static NTSTATUS PiPropAllocateBlob(_In_reads_bytes_(Size) PVOID Source, _In_ ULONG Size, _Outptr_result_bytebuffer_maybenull_(Size) PVOID *Blob)
Definition: pnpprop.c:919
static NTSTATUS PiPropCaptureString(_In_reads_bytes_(RawSize) PCWSTR Raw, _In_ ULONG RawSize, _In_ BOOLEAN IsList, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
Definition: pnpprop.c:938
#define REGSTR_VAL_DEVDESC
Definition: regstr.h:292
#define REGSTR_VAL_FRIENDLYNAME
Definition: regstr.h:465
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by PiPropReadBuiltin().

◆ PiPropReadDeviceRegistryProperty()

static NTSTATUS PiPropReadDeviceRegistryProperty ( _In_ PPIP_PROP_OBJECT  Object,
_In_ const PIP_BUILTIN_PROPERTY *  Builtin,
_Outptr_result_bytebuffer_maybenull_ *BlobSize PVOID *  Blob,
_Out_ PULONG  BlobSize 
)
static

Definition at line 1091 of file pnpprop.c.

1096{
1097 ULONG Length = 128, Needed;
1098 PVOID Buffer;
1100
1101 if (!Object->Pdo)
1103
1104 for (;;)
1105 {
1107 if (!Buffer)
1109
1111 (DEVICE_REGISTRY_PROPERTY)Builtin->Selector,
1112 Length,
1113 Buffer,
1114 &Needed);
1116 break;
1117
1119
1120 Length = ALIGN_UP_BY(max(Needed, Length * 2), sizeof(WCHAR));
1122 return STATUS_UNSUCCESSFUL;
1123 }
1124
1125 if (!NT_SUCCESS(Status))
1126 {
1128 return Status;
1129 }
1130
1131 if (Builtin->Type == DEVPROP_TYPE_STRING)
1132 {
1133 Status = PiPropCaptureString(Buffer, Needed, FALSE, Blob, BlobSize);
1135 return Status;
1136 }
1137
1138 if (Needed != PiPropTypeRules[Builtin->Type].Width)
1139 {
1142 }
1143
1144 *Blob = Buffer;
1145 *BlobSize = Needed;
1146 return STATUS_SUCCESS;
1147}
#define ALIGN_UP_BY(size, align)
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: d3dkmdt.h:46
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
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
#define PIP_PROP_MAX_QUERY_SIZE
Definition: pnpprop.c:26
#define max(a, b)
Definition: svc.c:63
DEVICE_REGISTRY_PROPERTY
Definition: iotypes.h:1194

Referenced by PiPropReadBuiltin().

◆ PiPropReadFromBuiltin()

static BOOLEAN PiPropReadFromBuiltin ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PPIP_PROP_NAME  Name,
_Inout_ PPIP_PROP_OUTPUT  Out,
_Out_ PNTSTATUS  Status 
)
static

Definition at line 1417 of file pnpprop.c.

1422{
1423 const PIP_BUILTIN_PROPERTY *Builtin;
1424 ULONG BlobSize;
1425 PVOID Blob;
1426
1427 if (Name->Locale.Length)
1428 return FALSE;
1429
1430 Builtin = PiPropFindBuiltin(Object, Name->Key);
1431 if (!Builtin)
1432 return FALSE;
1433
1434 *Status = PiPropReadBuiltin(Object, Builtin, &Blob, &BlobSize);
1435 if (NT_SUCCESS(*Status))
1436 {
1437 *Status = PiPropCopyOut(Builtin->Type, Blob, BlobSize,
1438 &Out->Type, Out->Data, Out->Size, &Out->Required);
1440 }
1441
1442 return TRUE;
1443}
static NTSTATUS PiPropReadBuiltin(_In_ PPIP_PROP_OBJECT Object, _In_ const PIP_BUILTIN_PROPERTY *Builtin, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
Definition: pnpprop.c:1300
static NTSTATUS PiPropCopyOut(_In_ DEVPROPTYPE SourceType, _In_reads_bytes_opt_(SourceSize) PVOID Source, _In_ ULONG SourceSize, _Out_ PDEVPROPTYPE Type, _Out_writes_bytes_to_opt_(Size, *RequiredSize) PVOID Data, _In_ ULONG Size, _Out_ PULONG RequiredSize)
Definition: pnpprop.c:427
DEVPROPTYPE Type
Definition: pnpprop.c:88

◆ PiPropReadFromSaved()

static BOOLEAN PiPropReadFromSaved ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PPIP_PROP_NAME  Name,
_Inout_ PPIP_PROP_OUTPUT  Out,
_Out_ PNTSTATUS  Status 
)
static

Definition at line 1469 of file pnpprop.c.

1474{
1476
1478 return FALSE;
1479
1482
1483 Saved = PiPropFindSaved(Object->Pdo);
1484 if (Saved)
1485 {
1486 *Status = PiPropCopyOut(Saved->Type, Saved->Data, Saved->Size,
1487 &Out->Type, Out->Data, Out->Size, &Out->Required);
1488 }
1489
1492
1493 return (Saved != NULL);
1494}
FORCEINLINE VOID ExAcquirePushLockShared(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1108
FORCEINLINE VOID ExReleasePushLockShared(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1216
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
static BOOLEAN PiPropIsInterruptKey(_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name)
Definition: pnpprop.c:401
static PPIP_PROP_SAVED_VALUE PiPropFindSaved(_In_ PDEVICE_OBJECT Pdo)
Definition: pnpprop.c:810
static EX_PUSH_LOCK PiPropSavedLock
Definition: pnpprop.c:805
UCHAR Data[ANYSIZE_ARRAY]
Definition: pnpprop.c:801
DEVPROPTYPE Type
Definition: pnpprop.c:799

◆ PiPropReadFromStore()

static BOOLEAN PiPropReadFromStore ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PPIP_PROP_NAME  Name,
_Inout_ PPIP_PROP_OUTPUT  Out,
_Out_ PNTSTATUS  Status 
)
static

Definition at line 1447 of file pnpprop.c.

1452{
1453 HANDLE ObjectKey;
1454
1455 /* Writers change one value at a time, and a key deleted under us reads as not found */
1456 *Status = PiPropOpenObjectKey(Object, KEY_READ, &ObjectKey);
1457 if (NT_SUCCESS(*Status))
1458 {
1459 *Status = PiPropStoreQuery(ObjectKey, Name, &Out->Type,
1460 Out->Data, Out->Size, &Out->Required);
1461 ZwClose(ObjectKey);
1462 }
1463
1465}
static NTSTATUS PiPropOpenObjectKey(_In_ PPIP_PROP_OBJECT Object, _In_ ACCESS_MASK DesiredAccess, _Out_ PHANDLE ObjectKey)
Definition: pnpprop.c:520
static NTSTATUS PiPropStoreQuery(_In_ HANDLE ObjectKey, _In_ PPIP_PROP_NAME Name, _Out_ PDEVPROPTYPE Type, _Out_writes_bytes_to_opt_(Size, *RequiredSize) PVOID Data, _In_ ULONG Size, _Out_ PULONG RequiredSize)
Definition: pnpprop.c:570

◆ PiPropReadInterfaceField()

static NTSTATUS PiPropReadInterfaceField ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PIP_PROP_FIELD  Field,
_Outptr_result_bytebuffer_maybenull_ *BlobSize PVOID *  Blob,
_Out_ PULONG  BlobSize 
)
static

Definition at line 1229 of file pnpprop.c.

1234{
1235 UNICODE_STRING ControlName = RTL_CONSTANT_STRING(L"Control");
1236 HANDLE DeviceKey, InstanceKey, ControlKey;
1239 UNICODE_STRING Reference;
1241
1242 Status = IopOpenDeviceInterfaceKeys(Object->Name, KEY_READ, &DeviceKey, &InstanceKey);
1243 if (!NT_SUCCESS(Status))
1244 return Status;
1245
1246 switch (Field)
1247 {
1249 *BlobSize = sizeof(GUID);
1250 Status = PiPropAllocateBlob(&Object->ClassGuid, sizeof(GUID), Blob);
1251 break;
1252
1255 if (NT_SUCCESS(IopOpenRegistryKeyEx(&ControlKey, InstanceKey, &ControlName, KEY_QUERY_VALUE)))
1256 {
1257 if (NT_SUCCESS(IopGetRegistryValue(ControlKey, L"Linked", &Info)))
1258 {
1259 if ((Info->Type == REG_DWORD) &&
1260 (Info->DataLength == sizeof(ULONG)) &&
1261 (*(PULONG)((PUCHAR)Info + Info->DataOffset) != 0))
1262 {
1264 }
1266 }
1267 ZwClose(ControlKey);
1268 }
1269
1270 *BlobSize = sizeof(Enabled);
1271 Status = PiPropAllocateBlob(&Enabled, sizeof(Enabled), Blob);
1272 break;
1273
1275 Status = PiPropReadRegistryValue(DeviceKey, L"DeviceInstance", REG_SZ,
1276 DEVPROP_TYPE_STRING, Blob, BlobSize);
1277 break;
1278
1280 Status = PiPropGetInterfaceReference(Object->Name, &Reference);
1281 if (!NT_SUCCESS(Status))
1282 break;
1283
1284 Status = PiPropCaptureString(Reference.Buffer, Reference.Length, FALSE, Blob, BlobSize);
1285 break;
1286
1287 default:
1288 ASSERT(FALSE);
1290 break;
1291 }
1292
1293 ZwClose(InstanceKey);
1294 ZwClose(DeviceKey);
1295 return Status;
1296}
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
@ Enabled
Definition: mountmgr.h:179
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
NTSTATUS NTAPI IopGetRegistryValue(IN HANDLE Handle, IN PWSTR ValueName, OUT PKEY_VALUE_FULL_INFORMATION *Information)
Definition: pnpmgr.c:1036
static NTSTATUS NTAPI PiPropGetInterfaceReference(_In_ PCUNICODE_STRING LinkName, _Out_ PUNICODE_STRING Reference)
Definition: pnpprop.c:488
static NTSTATUS PiPropReadRegistryValue(_In_ HANDLE KeyHandle, _In_ PCWSTR ValueName, _In_ ULONG RegType, _In_ DEVPROPTYPE Type, _Outptr_result_bytebuffer_maybenull_(*BlobSize) PVOID *Blob, _Out_ PULONG BlobSize)
Definition: pnpprop.c:983
#define REG_DWORD
Definition: sdbapi.c:615
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PUCHAR
Definition: typedefs.h:53

Referenced by PiPropReadBuiltin().

◆ PiPropReadKeyValue()

static NTSTATUS PiPropReadKeyValue ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PCWSTR  ValueName,
_In_ ULONG  RegType,
_In_ DEVPROPTYPE  Type,
_Outptr_result_bytebuffer_maybenull_ *BlobSize PVOID *  Blob,
_Out_ PULONG  BlobSize 
)
static

Definition at line 1069 of file pnpprop.c.

1076{
1077 HANDLE ObjectKey;
1079
1081 if (!NT_SUCCESS(Status))
1082 return Status;
1083
1084 Status = PiPropReadRegistryValue(ObjectKey, ValueName, RegType, Type, Blob, BlobSize);
1085 ZwClose(ObjectKey);
1086 return Status;
1087}
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243

Referenced by PiPropReadBuiltin(), and PiPropReadDeviceNodeField().

◆ PiPropReadRegistryValue()

static NTSTATUS PiPropReadRegistryValue ( _In_ HANDLE  KeyHandle,
_In_ PCWSTR  ValueName,
_In_ ULONG  RegType,
_In_ DEVPROPTYPE  Type,
_Outptr_result_bytebuffer_maybenull_ *BlobSize PVOID *  Blob,
_Out_ PULONG  BlobSize 
)
static

Definition at line 983 of file pnpprop.c.

990{
992 PVOID RawData;
993 ULONG RawSize;
995
997 if (!NT_SUCCESS(Status))
998 return Status;
999
1000 RawData = (PUCHAR)Info + Info->DataOffset;
1001 RawSize = Info->DataLength;
1002
1003 /* REG_EXPAND_SZ is accepted where REG_SZ is expected */
1004 if ((Info->Type != RegType) &&
1005 !((RegType == REG_SZ) && (Info->Type == REG_EXPAND_SZ)))
1006 {
1007 DPRINT1("Value '%S' has type %lu, expected %lu\n", ValueName, Info->Type, RegType);
1010 }
1011
1012 switch (Type)
1013 {
1016 Status = PiPropCaptureString(RawData,
1017 RawSize,
1019 Blob,
1020 BlobSize);
1021 break;
1022
1024 if (RawSize != sizeof(ULONG))
1025 {
1027 break;
1028 }
1029 Status = PiPropAllocateBlob(RawData, RawSize, Blob);
1030 *BlobSize = RawSize;
1031 break;
1032
1033 case DEVPROP_TYPE_GUID:
1034 {
1036 GUID Guid;
1037
1038 Status = PiPropCaptureString(RawData, RawSize, FALSE, Blob, BlobSize);
1039 if (!NT_SUCCESS(Status))
1040 break;
1041
1044 if (NT_SUCCESS(Status))
1045 {
1046 RtlCopyMemory(*Blob, &Guid, sizeof(Guid));
1047 *BlobSize = sizeof(Guid);
1048 }
1049 else
1050 {
1053 }
1054 break;
1055 }
1056
1057 default:
1058 ASSERT(FALSE);
1060 break;
1061 }
1062
1064 return Status;
1065}
#define DEVPROP_TYPE_GUID
Definition: devpropdef.h:42
#define DEVPROP_TYPE_UINT32
Definition: devpropdef.h:36
#define DEVPROP_TYPE_STRING_LIST
Definition: devpropdef.h:48
if(dx< 0)
Definition: linetemp.h:194
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
uint16_t * PWSTR
Definition: typedefs.h:56
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:762

Referenced by PiPropReadInterfaceField(), and PiPropReadKeyValue().

◆ PiPropReleaseDevice()

VOID PiPropReleaseDevice ( _In_ PDEVICE_OBJECT  DeviceObject)

Definition at line 1731 of file pnpprop.c.

1733{
1734 PAGED_CODE();
1735
1737}
static NTSTATUS PiPropReplaceSaved(_In_ PDEVICE_OBJECT Pdo, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size, _Out_opt_ PBOOLEAN Replaced)
Definition: pnpprop.c:829
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2061

Referenced by IopDeleteDevice().

◆ PiPropReplaceSaved()

static NTSTATUS PiPropReplaceSaved ( _In_ PDEVICE_OBJECT  Pdo,
_In_ DEVPROPTYPE  Type,
_In_reads_bytes_opt_(Size) PVOID  Data,
_In_ ULONG  Size,
_Out_opt_ PBOOLEAN  Replaced 
)
static

Definition at line 829 of file pnpprop.c.

835{
836 PPIP_PROP_SAVED_VALUE Fresh = NULL, Stale;
837
839 {
843 if (!Fresh)
845
846 Fresh->Pdo = Pdo;
847 Fresh->Type = Type;
848 Fresh->Size = Size;
849 if (Size)
850 RtlCopyMemory(Fresh->Data, Data, Size);
851 }
852
855
856 Stale = PiPropFindSaved(Pdo);
857 if (Stale)
858 RemoveEntryList(&Stale->Link);
859 if (Fresh)
860 InsertTailList(&PiPropSavedValues, &Fresh->Link);
861
864
865 if (Replaced)
866 *Replaced = (Stale != NULL);
867
868 if (Stale)
870
871 return STATUS_SUCCESS;
872}
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1039
FORCEINLINE VOID ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1255
LIST_ENTRY Link
Definition: pnpprop.c:797
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by PiPropReleaseDevice(), and PiPropStoreApply().

◆ PiPropSet()

static NTSTATUS PiPropSet ( _In_ PPIP_PROP_OBJECT  Object,
_In_ const DEVPROPKEY *  PropertyKey,
_In_ LCID  Lcid,
_In_ DEVPROPTYPE  Type,
_In_ ULONG  Size,
_In_reads_bytes_opt_(Size) PVOID  Data 
)
static

Definition at line 1629 of file pnpprop.c.

1636{
1637 const PIP_BUILTIN_PROPERTY *Builtin;
1641
1642 PAGED_CODE();
1643
1644 if (!PropertyKey)
1646
1648 if (!NT_SUCCESS(Status))
1649 return Status;
1650
1652 if (!NT_SUCCESS(Status))
1653 return Status;
1654
1655 if ((Type == DEVPROP_TYPE_STRING_INDIRECT) && Name.Locale.Length)
1657
1658 Target = PiPropPickTarget(Object, &Name, &Builtin);
1659 if (Target == PipTargetDenied)
1660 return STATUS_ACCESS_DENIED;
1661
1664
1665 if (Target == PipTargetBuiltin)
1667 else
1669
1672
1673 if (Object->DeviceNode && PiPropShouldAnnounce(Object->DeviceNode))
1674 IopQueueDevicePropertyChangeEvent(&Object->DeviceNode->InstancePath);
1675
1677}
#define DEVPROP_TYPE_STRING_INDIRECT
Definition: devpropdef.h:56
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
NTSTATUS IopQueueDevicePropertyChangeEvent(_In_ PCUNICODE_STRING DeviceId)
Definition: plugplay.c:136
ERESOURCE PpRegistryDeviceResource
Definition: pnpmgr.c:18
static NTSTATUS PiPropCheckPayload(_In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
Definition: pnpprop.c:292
static NTSTATUS PiPropWriteBuiltin(_In_ PPIP_PROP_OBJECT Object, _In_ const PIP_BUILTIN_PROPERTY *Builtin, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
Definition: pnpprop.c:1333
static PIP_PROP_TARGET PiPropPickTarget(_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Out_ const PIP_BUILTIN_PROPERTY **Builtin)
Definition: pnpprop.c:1551
static NTSTATUS PiPropStoreApply(_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
Definition: pnpprop.c:1570
static BOOLEAN PiPropShouldAnnounce(_In_ PDEVICE_NODE DeviceNode)
Definition: pnpprop.c:1612
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

Referenced by _IRQL_requires_max_().

◆ PiPropShouldAnnounce()

static BOOLEAN PiPropShouldAnnounce ( _In_ PDEVICE_NODE  DeviceNode)
inlinestatic

Definition at line 1612 of file pnpprop.c.

1614{
1615 switch (DeviceNode->State)
1616 {
1620 return FALSE;
1621
1622 default:
1623 return TRUE;
1624 }
1625}
@ DeviceNodeInitialized
Definition: iotypes.h:541
@ DeviceNodeUninitialized
Definition: iotypes.h:540
@ DeviceNodeUnspecified
Definition: iotypes.h:539

Referenced by PiPropSet().

◆ PiPropStoreApply()

static NTSTATUS PiPropStoreApply ( _In_ PPIP_PROP_OBJECT  Object,
_In_ PPIP_PROP_NAME  Name,
_In_ DEVPROPTYPE  Type,
_In_reads_bytes_opt_(Size) PVOID  Data,
_In_ ULONG  Size 
)
static

Definition at line 1570 of file pnpprop.c.

1576{
1577 BOOLEAN Replaced;
1578 HANDLE ObjectKey;
1580
1582 if (NT_SUCCESS(Status))
1583 {
1584 if (Type == DEVPROP_TYPE_EMPTY)
1585 Status = PiPropStoreDelete(ObjectKey, Name);
1586 else
1587 Status = PiPropStoreWrite(ObjectKey, Name, Type, Data, Size);
1588
1589 ZwClose(ObjectKey);
1590 }
1591
1593 return Status;
1594
1595 if (NT_SUCCESS(Status))
1596 return PiPropReplaceSaved(Object->Pdo, Type, Data, Size, NULL);
1597
1598 /* Deleting a value that only exists in the saved copy still succeeds */
1599 if ((Type == DEVPROP_TYPE_EMPTY) &&
1601 {
1602 PiPropReplaceSaved(Object->Pdo, Type, NULL, 0, &Replaced);
1603 if (Replaced)
1605 }
1606
1607 return Status;
1608}
static NTSTATUS PiPropStoreWrite(_In_ HANDLE ObjectKey, _In_ PPIP_PROP_NAME Name, _In_ DEVPROPTYPE Type, _In_reads_bytes_opt_(Size) PVOID Data, _In_ ULONG Size)
Definition: pnpprop.c:705
static NTSTATUS PiPropStoreDelete(_In_ HANDLE ObjectKey, _In_ PPIP_PROP_NAME Name)
Definition: pnpprop.c:758

Referenced by PiPropSet().

◆ PiPropStoreDelete()

static NTSTATUS PiPropStoreDelete ( _In_ HANDLE  ObjectKey,
_In_ PPIP_PROP_NAME  Name 
)
static

Definition at line 758 of file pnpprop.c.

761{
763 PUNICODE_STRING Chain[] = { &PropertiesName, &Name->Fmtid, &Name->Pid };
764 HANDLE Keys[RTL_NUMBER_OF(Chain) + 1];
765 ULONG Depth;
767
768 Keys[0] = ObjectKey;
769 for (Depth = 0; Depth < RTL_NUMBER_OF(Chain); Depth++)
770 {
771 Status = IopOpenRegistryKeyEx(&Keys[Depth + 1],
772 Keys[Depth],
773 Chain[Depth],
775 if (!NT_SUCCESS(Status))
776 break;
777 }
778
779 if (NT_SUCCESS(Status))
780 Status = ZwDeleteValueKey(Keys[Depth], &Name->Locale);
781
782 for (; Depth > 0; Depth--)
783 {
785 ZwDeleteKey(Keys[Depth]);
786
787 ZwClose(Keys[Depth]);
788 }
789
790 return Status;
791}
NTSYSAPI NTSTATUS NTAPI ZwDeleteValueKey(__in IN HANDLE Key, __in IN PUNICODE_STRING ValueName)
static BOOLEAN PiPropIsKeyEmpty(_In_ HANDLE KeyHandle)
Definition: pnpprop.c:734

Referenced by PiPropStoreApply().

◆ PiPropStoreQuery()

static NTSTATUS PiPropStoreQuery ( _In_ HANDLE  ObjectKey,
_In_ PPIP_PROP_NAME  Name,
_Out_ PDEVPROPTYPE  Type,
_Out_writes_bytes_to_opt_(Size, *RequiredSize) PVOID  Data,
_In_ ULONG  Size,
_Out_ PULONG  RequiredSize 
)
static

Definition at line 570 of file pnpprop.c.

577{
578 struct
579 {
581 UCHAR Inline[64];
582 } Small;
584 WCHAR PathBuffer[PIP_PROP_PATH_CHARS];
587 ULONG InfoSize;
589
590 Status = PiPropBuildValuePath(Name, &Path, PathBuffer);
591 if (!NT_SUCCESS(Status))
592 return Status;
593
595 if (!NT_SUCCESS(Status))
596 return Status;
597
598 InfoSize = sizeof(Small);
599 for (;;)
600 {
601 Status = ZwQueryValueKey(PropertyKey,
602 &Name->Locale,
604 Info,
605 InfoSize,
606 &InfoSize);
608 break;
609
610 if (Info != &Small.Info)
612
614 if (!Info)
615 {
617 break;
618 }
619 }
621
622 if (NT_SUCCESS(Status))
623 {
625 {
627 Info->Data,
628 Info->DataLength,
629 Type,
630 Data,
631 Size,
633 }
634 else
635 {
636 DPRINT1("Unexpected value type 0x%lx for %wZ\\%wZ\n",
637 Info->Type, &Name->Fmtid, &Name->Pid);
639 }
640 }
641
642 if (Info && (Info != &Small.Info))
644
645 return Status;
646}
@ KeyValuePartialInformation
Definition: nt_native.h:1185
static NTSTATUS PiPropBuildValuePath(_In_ PPIP_PROP_NAME Name, _Out_ PUNICODE_STRING Path, _Out_writes_(PIP_PROP_PATH_CHARS) PWCHAR Buffer)
Definition: pnpprop.c:555
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
unsigned char UCHAR
Definition: typedefs.h:53

Referenced by PiPropReadFromStore().

◆ PiPropStoreWrite()

static NTSTATUS PiPropStoreWrite ( _In_ HANDLE  ObjectKey,
_In_ PPIP_PROP_NAME  Name,
_In_ DEVPROPTYPE  Type,
_In_reads_bytes_opt_(Size) PVOID  Data,
_In_ ULONG  Size 
)
static

Definition at line 705 of file pnpprop.c.

711{
713 PCUNICODE_STRING Parts[] = { &PropertiesName, &Name->Fmtid, &Name->Pid };
714 WCHAR PathBuffer[PIP_PROP_PATH_CHARS];
716 HANDLE ValueKey;
718
719 Status = PiPropBuildValuePath(Name, &Path, PathBuffer);
720 if (!NT_SUCCESS(Status))
721 return Status;
722
723 Status = IopOpenRegistryKeyEx(&ValueKey, ObjectKey, &Path, KEY_SET_VALUE);
724 if (!NT_SUCCESS(Status))
725 return PiPropCreateBranch(ObjectKey, Parts, RTL_NUMBER_OF(Parts), Name, Type, Data, Size);
726
727 Status = PiPropPutValue(ValueKey, Name, Type, Data, Size);
728 ZwClose(ValueKey);
729 return Status;
730}

Referenced by PiPropStoreApply().

◆ PiPropWriteBuiltin()

static NTSTATUS PiPropWriteBuiltin ( _In_ PPIP_PROP_OBJECT  Object,
_In_ const PIP_BUILTIN_PROPERTY *  Builtin,
_In_ DEVPROPTYPE  Type,
_In_reads_bytes_opt_(Size) PVOID  Data,
_In_ ULONG  Size 
)
static

Definition at line 1333 of file pnpprop.c.

1339{
1340 static const UNICODE_STRING RootEnumerator = RTL_CONSTANT_STRING(L"ROOT\\");
1342 HANDLE ObjectKey;
1344
1345 if ((Builtin->Flags & PIP_PROP_READ_ONLY) ||
1346 (Builtin->Source != PipSourceKeyValue))
1347 {
1348 return STATUS_ACCESS_DENIED;
1349 }
1350
1351 if ((Builtin->Flags & PIP_PROP_ROOT_ENUM_WRITE) &&
1352 !RtlPrefixUnicodeString(&RootEnumerator, Object->Name, TRUE))
1353 {
1354 return STATUS_ACCESS_DENIED;
1355 }
1356
1357 if ((Type != DEVPROP_TYPE_EMPTY) && (Type != Builtin->Type))
1359
1361 if (!NT_SUCCESS(Status))
1362 return Status;
1363
1364 RtlInitUnicodeString(&ValueName, Builtin->ValueName);
1365
1366 if (Type == DEVPROP_TYPE_EMPTY)
1367 {
1368 Status = ZwDeleteValueKey(ObjectKey, &ValueName);
1369 }
1370 else if (Type == DEVPROP_TYPE_GUID)
1371 {
1373 GUID Guid;
1374
1375 RtlCopyMemory(&Guid, Data, sizeof(Guid));
1377 if (NT_SUCCESS(Status))
1378 {
1379 Status = ZwSetValueKey(ObjectKey,
1380 &ValueName,
1381 0,
1382 REG_SZ,
1383 GuidString.Buffer,
1384 GuidString.Length + sizeof(UNICODE_NULL));
1386 }
1387 }
1388 else
1389 {
1390 Status = ZwSetValueKey(ObjectKey, &ValueName, 0, Builtin->Selector, Data, Size);
1391 }
1392
1393 ZwClose(ObjectKey);
1394 return Status;
1395}
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define PIP_PROP_ROOT_ENUM_WRITE
Definition: pnpprop.c:29
#define PIP_PROP_READ_ONLY
Definition: pnpprop.c:28
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)

Referenced by PiPropSet().

◆ RTL_STATIC_LIST_HEAD()

static RTL_STATIC_LIST_HEAD ( PiPropSavedValues  )
static

Variable Documentation

◆ PipDeviceBuiltins

const PIP_BUILTIN_PROPERTY PipDeviceBuiltins[]
static

Definition at line 97 of file pnpprop.c.

Referenced by PiPropBuiltinTable().

◆ PipInterfaceBuiltins

const PIP_BUILTIN_PROPERTY PipInterfaceBuiltins[]
static
Initial value:

Definition at line 132 of file pnpprop.c.

Referenced by PiPropBuiltinTable().

◆ PiPropInterruptKey

const DEVPROPKEY PiPropInterruptKey
static
Initial value:
=
{
{ 0xF0E20F09, 0xD97A, 0x49A9, { 0x80, 0x46, 0xBB, 0x6E, 0x22, 0xE6, 0xBB, 0x2E } },
2
}

Definition at line 140 of file pnpprop.c.

Referenced by PiPropIsInterruptKey().

◆ PiPropReaders

const PIP_PROP_READER PiPropReaders[]
static
Initial value:
=
{
}
static BOOLEAN PiPropReadFromBuiltin(_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Inout_ PPIP_PROP_OUTPUT Out, _Out_ PNTSTATUS Status)
Definition: pnpprop.c:1417
static BOOLEAN PiPropReadFromSaved(_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Inout_ PPIP_PROP_OUTPUT Out, _Out_ PNTSTATUS Status)
Definition: pnpprop.c:1469
static BOOLEAN PiPropReadFromStore(_In_ PPIP_PROP_OBJECT Object, _In_ PPIP_PROP_NAME Name, _Inout_ PPIP_PROP_OUTPUT Out, _Out_ PNTSTATUS Status)
Definition: pnpprop.c:1447

Definition at line 1496 of file pnpprop.c.

Referenced by PiPropGet().

◆ PiPropSavedLock

EX_PUSH_LOCK PiPropSavedLock
static

Definition at line 805 of file pnpprop.c.

Referenced by PiPropReadFromSaved(), and PiPropReplaceSaved().

◆ PiPropTypeRules

const PIP_PROP_TYPE_RULE PiPropTypeRules[MAX_DEVPROP_TYPE+1]
static
Initial value:
=
{
{ sizeof(CHAR), FALSE, PipCheckNone },
{ sizeof(UCHAR), FALSE, PipCheckNone },
{ sizeof(SHORT), FALSE, PipCheckNone },
{ sizeof(USHORT), FALSE, PipCheckNone },
{ sizeof(LONG), FALSE, PipCheckNone },
{ sizeof(ULONG), FALSE, PipCheckNone },
{ sizeof(LONGLONG), FALSE, PipCheckNone },
{ sizeof(ULONGLONG), FALSE, PipCheckNone },
{ sizeof(ULONG), FALSE, PipCheckNone },
{ sizeof(ULONGLONG), FALSE, PipCheckNone },
{ 16, FALSE, PipCheckNone },
{ sizeof(GUID), FALSE, PipCheckNone },
{ sizeof(LONGLONG), FALSE, PipCheckNone },
{ sizeof(ULONGLONG), FALSE, PipCheckNone },
{ 0, TRUE, PipCheckString },
{ 0, TRUE, PipCheckString },
{ sizeof(DEVPROPKEY), FALSE, PipCheckNone },
{ sizeof(DEVPROPTYPE), FALSE, PipCheckNone },
{ sizeof(ULONG), FALSE, PipCheckNone },
{ sizeof(NTSTATUS), FALSE, PipCheckNone },
}
#define CHAR(Char)
struct _DEVPROPKEY DEVPROPKEY
#define NTSTATUS
Definition: precomp.h:19
short SHORT
Definition: pedump.c:59
long LONG
Definition: pedump.c:60
union _LARGE_INTEGER LARGE_INTEGER
uint64_t ULONGLONG
Definition: typedefs.h:67

Definition at line 176 of file pnpprop.c.

Referenced by PiPropCheckPayload(), and PiPropReadDeviceRegistryProperty().